Add an Anthropic, OpenAI, or Google API key

configuration & security

// what it does

openclaw models auth paste-api-key stores an API key as an auth profile for a provider; openclaw models auth login runs the OAuth flow where a provider supports it. Keys can also come from env (OPENROUTER_API_KEY and the like) or be pasted during openclaw onboard.

// shell

$ openclaw models auth paste-api-key --provider anthropic
$ openclaw models auth login --provider openai

// gotcha

Auth profiles are per-agent, stored in ~/.openclaw/agents/<id>/agent/auth-profiles.json — adding a key for one agent does not authorize another. Re-run auth per agent, or configure it under agents.defaults.

// resources