Use Anthropic with OpenClaw
Connect Claude models to OpenClaw with an Anthropic API key or an existing Claude CLI login, then verify the active route.
OpenClaw supports two Anthropic authentication paths: direct API access with usage-based billing, or reuse of a Claude CLI login on the same host.
Option 1: Anthropic API key
Run the interactive onboarding flow and choose Anthropic API key:
openclaw onboard
This is the clearest option for a shared or long-running Gateway because the credential and billing boundary are explicit. Store the key through the supported credential flow or a protected service environment, not in a public configuration file.
Option 2: reuse Claude CLI login
First confirm that Claude CLI is installed and signed in on the same host that runs OpenClaw:
claude --version
openclaw onboard
Choose Claude CLI during onboarding. This path depends on the local Claude CLI login and runtime compatibility. A container or remote Gateway does not automatically inherit credentials from the host user’s ~/.claude directory.
Discover and select a model
openclaw models list --provider anthropic
openclaw models status
openclaw models set <anthropic/model-id>
Use the exact anthropic/* reference reported by the current CLI. Rolling aliases and provider catalogs can change, so pin an exact model reference when reproducibility matters.
Verify the connection
Test a normal answer and a harmless tool call. If a newly created agent reports no Anthropic key, remember that credentials can be scoped per agent; configure that agent rather than copying secrets into its prompt.
Expected result
The provider appears in openclaw models status, the selected model is available, and a test turn completes without a missing-credential, expired-token, or provider-policy error.
Source notes
Technical facts on this page were checked against primary sources.