Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
OpenClaw supports OAuth and API keys for model providers. For always-on gateway hosts, API keys are usually the most predictable option. Subscription/OAuth flows are also supported when they match your provider account model.
See /concepts/oauth for the full OAuth flow and storage layout. For SecretRef-based auth (
envfileexecmodels status --probeIf you’re running a long-lived gateway, start with an API key for your chosen provider. For Anthropic specifically, API key auth is still the most predictable server setup, but OpenClaw also supports reusing a local Claude CLI login.
openclaw gatewaybashexport <PROVIDER>_API_KEY="..." openclaw models status
~/.openclaw/.envbashcat >> ~/.openclaw/.env <<'EOF' <PROVIDER>_API_KEY=... EOF
Then restart the daemon (or restart your Gateway process) and re-check:
bashopenclaw models status openclaw doctor
If you’d rather not manage env vars yourself, onboarding can store API keys for daemon use:
openclaw onboardSee Help for details on env inheritance (
env.shellEnv~/.openclaw/.envAnthropic setup-token auth is still available in OpenClaw as a supported token path. Anthropic staff has since told us that OpenClaw-style Claude CLI usage is allowed again, so OpenClaw treats Claude CLI reuse and
claude -pFor long-lived gateway hosts, an Anthropic API key is still the most predictable setup. If you want to reuse an existing Claude login on the same host, use the Anthropic Claude CLI path in onboarding/configure.
Recommended host setup for Claude CLI reuse:
bash# Run on the gateway host claude auth login claude auth status --text openclaw models auth login --provider anthropic --method cli --set-default
This is a two-step setup:
claude-cliIf
claudePATHagents.defaults.cliBackends.claude-cli.commandManual token entry (any provider; writes
auth-profiles.jsonbashopenclaw models auth paste-token --provider openrouter
auth-profiles.jsonjson{ "version": 1, "profiles": { "openrouter:default": { "type": "api_key", "provider": "openrouter", "key": "OPENROUTER_API_KEY" } } }
OpenClaw expects the canonical
versionprofiles{ "openrouter": { "apiKey": "..." } }openclaw doctor --fixopenrouter:default.legacy-flat.*.bakbaseUrlapimodels.providers.<id>openclaw.jsonmodels.jsonauth-profiles.jsonAuth profile refs are also supported for static credentials:
api_keykeyRef: { source, provider, id }tokentokenRef: { source, provider, id }auth.profiles.<id>.mode"oauth"keyReftokenRefAutomation-friendly check (exit
12bashopenclaw models status --check
Live auth probes:
bashopenclaw models status --probe
Notes:
models.jsonauth.order.<provider>excluded_by_auth_orderstatus: no_modelOptional ops scripts (systemd/Termux) are documented here: Auth monitoring scripts
The Anthropic
claude-cliclaude -pbashopenclaw models status openclaw doctor
Some providers support retrying a request with alternative keys when an API call hits a provider rate limit.
OPENCLAW_LIVE_<PROVIDER>_KEY<PROVIDER>_API_KEYS<PROVIDER>_API_KEY<PROVIDER>_API_KEY_*GOOGLE_API_KEY429rate_limitquotaresource exhaustedToo many concurrent requestsThrottlingExceptionconcurrency limit reachedworkers_ai ... quota limit exceededUse
/model <alias-or-id>@<profileId>anthropic:defaultanthropic:workUse
/model/model list/model statusSet an explicit auth profile order override for an agent (stored in that agent’s
auth-state.jsonbashopenclaw models auth order get --provider anthropic openclaw models auth order set --provider anthropic anthropic:default openclaw models auth order clear --provider anthropic
Use
--agent <id>openclaw models status --probeexcluded_by_auth_orderIf the Anthropic profile is missing, configure an Anthropic API key on the gateway host or set up the Anthropic setup-token path, then re-check:
bashopenclaw models status
Run
openclaw models status© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine