#Claude token key
1 messages · Page 1 of 1 (latest)
Yep — you can add/switch this after install. Also: don’t paste any tokens/keys in this thread.
First, quick clarification: which “token key” do you mean?
A) Anthropic / Claude setup-token (Claude Pro/Max subscription auth)
This is the “token” OpenClaw supports (it comes from Claude Code), not something from the Anthropic web console.
On the machine that runs your OpenClaw gateway, either:
- generate + store it in one go:
openclaw models auth setup-token --provider anthropic
or if you already generated it elsewhere with claude setup-token, paste it:
openclaw models auth paste-token --provider anthropic
Then verify:
openclaw models status
Docs: https://docs.openclaw.ai/help/faq#where-do-i-find-an-anthropic-setuptoken
(and https://docs.openclaw.ai/help/faq#how-does-anthropic-setuptoken-auth-work)
B) Gateway/Dashboard access token (to connect the Control UI)
That token is gateway.auth.token. You can view/generate it on the gateway host:
openclaw config get gateway.auth.token
openclaw doctor --generate-gateway-token
Docs: https://docs.openclaw.ai/help/faq#how-do-i-authenticate-the-dashboard-token-on-localhost-vs-remote
If you tell me which one you meant and your openclaw --version (no secrets), I can point you at the exact fix for your setup.
I paid $20 to get the monthly membership from Claude code I generated thru my terminal I paste it and it didn’t work
If you generated a Claude setup-token and OpenClaw rejected it, it’s usually one of these:
- Wrong token type copied (not the
setup-token), or - Old OpenClaw version that doesn’t understand the current token format.
A real Claude setup-token (from claude setup-token) should start with:
sk-ant-oat01-... (and it’s long — ~80+ chars)
You don’t need to paste it here — just check whether yours starts with that prefix.
Best “no copy/paste” way (run on the SAME machine where the Gateway runs)
openclaw models auth setup-token --provider anthropic
openclaw models status
If it still fails
Please paste only:
openclaw --version- the exact error message OpenClaw showed when you pasted the token (no secrets)
Docs: https://docs.openclaw.ai/providers/anthropic and https://docs.openclaw.ai/help/faq#where-do-i-find-an-anthropic-setuptoken
So I installed it with a api key from Claude but I was wondering if I can change it to the token when I would generate it it was on the same iMac about 2 days ago and it did start with sk ant
Yep — you can switch after install. No reinstall needed.
A quick sanity check first, because API keys and setup-tokens both start with sk-ant-:
- Anthropic API key usually looks like:
sk-ant-... - Claude setup-token (from
claude setup-token) should start with:sk-ant-oat01-...
So if your “token” only starts with sk-ant- but doesn’t include oat01, it’s probably just another API key.
Switch OpenClaw to the setup-token (on the same iMac where the Gateway runs)
Run one of these:
Option 1 (easiest, avoids copy/paste)
openclaw models auth setup-token --provider anthropic
Option 2 (paste a token you already generated)
openclaw models auth paste-token --provider anthropic
Then verify:
openclaw models status
If the Gateway is running as a service, restart it after changing auth:
openclaw gateway restart
If you tell me what your token prefix is up to the first 12–15 chars (example: sk-ant-oat01-… vs sk-ant-… — don’t paste the full token), I can confirm which kind you have.
What’s the difference from the api key and token I do know api is expensive im burning thru money quick
In OpenClaw, Anthropic API key and Claude setup-token are two different billing/auth paths:
Anthropic API key (sk-ant-… from the Anthropic Console)
- Billing: pay‑as‑you‑go per token (this is the “burning money quick” path).
- Pros: most “official”/stable for API usage; you can control spend with Anthropic billing limits.
- Extra note: OpenClaw can use Anthropic prompt caching with API keys (can reduce cost when you reuse the same big context a lot).
Claude setup-token (sk-ant-oat01-… from claude setup-token)
- Billing: uses your Claude Pro/Max subscription (not your Anthropic API billing).
- Pros: can be way cheaper if you’re currently paying per-token with an API key.
- Cons: still has subscription usage limits, and tokens can expire / get revoked → you may need to re-run
claude setup-tokenoccasionally.
Docs:
- https://docs.openclaw.ai/providers/anthropic
- https://docs.openclaw.ai/help/faq#oauth-vs-api-key-whats-the-difference
If you want to stop the bleeding right now
- Switch to setup-token auth (subscription), or
- Stay on API key but switch your default model to a cheaper one via
/model list(don’t guess—pick from the list), and consider turning thinking down/off for casual chat.
If you tell me whether you’re using an API key right now (Anthropic Console billing) or a setup-token (subscription), I can suggest the most cost-effective config path.
Claude setup-token gives a different token what openclaw expecting, like there is no sk-ant-oat01 at the beginning in the token
Yeah — if your claude setup-token output doesn’t start with sk-ant-oat01-, OpenClaw will reject it (it currently validates the prefix/length for Anthropic setup-tokens).
So either:
- you’re not copying the actual token line from
claude setup-token, or - Claude Code CLI changed the setup-token format and your OpenClaw version hasn’t caught up yet.
Can you paste only (no secrets):
openclaw --versionclaude --version- the exact error OpenClaw shows when you paste the token (e.g. “Expected token starting with …”)
Workaround until it’s fixed: use an Anthropic API key (pay-per-token), or upgrade OpenClaw (openclaw update + openclaw gateway restart). If it still fails on latest, this is very likely a real bug → please file an issue with the versions + the first ~10 chars of the token prefix (not the full token): https://github.com/openclaw/openclaw/issues
2.1.69 (Claude Code)
openclaw 2026.3.2
Thanks — with openclaw 2026.3.2, OpenClaw is currently expecting Anthropic setup-tokens to look like:
- prefix:
sk-ant-oat01-... - and be fairly long (it rejects “short” tokens)
So if Claude Code 2.1.69 is generating something without sk-ant-oat01-, that’s a real compatibility break (either new token prefix like …oat02…/something else, or you’re seeing a different credential type).
Can you share (redacted — don’t paste the full token):
- the first ~12–20 characters of what
claude setup-tokenprints (example:sk-ant-xxxx...) - the exact OpenClaw error message when you paste it
If it’s a new prefix, this likely needs an OpenClaw update → please file a bug with those two details + versions here:
https://github.com/openclaw/openclaw/issues
Workaround meanwhile: use an Anthropic API key (pay-per-token) and reduce burn by switching to a cheaper model via /model list + disabling thinking for casual chat (setup-token path won’t work until the prefix issue is fixed).
Delete that message right now (and generate a new setup-token). What you just pasted looks like a live credential — assume it’s compromised the moment it hits Discord logs / bots / search.
After you delete + regenerate:
- OpenClaw 2026.3.2 is expecting an Anthropic setup-token that starts with
sk-ant-oat01-…. - The string you pasted doesn’t match that format, so OpenClaw will reject it. This looks like a Claude Code CLI token format change.
Next step (safe to paste here):
- Run:
claude setup-token --help
and paste the output (no secrets).
2) File a bug with versions + “Claude setup-token no longer starts with sk-ant-oat01-”:
https://github.com/openclaw/openclaw/issues
Workaround until OpenClaw supports the new format: stick with an Anthropic API key (and use /model list to pick a cheaper model to stop the spend).
zso@openclaw:~$ claude setup-token --help
Usage: claude setup-token [options]
Set up a long-lived authentication token (requires Claude subscription)
Options:
-h, --help Display help for command
Got it — that --help output confirms there are no flags to force an “old style” token format.
So with:
- Claude Code 2.1.69
- openclaw 2026.3.2
…if claude setup-token is now emitting an opaque token that doesn’t start with sk-ant-oat01-, then OpenClaw’s current setup-token parser is out of date and will reject it. There isn’t a clean user-side fix besides waiting for an OpenClaw update.
What to do next:
- Please revoke/regenerate the token you pasted earlier (treat it as compromised).
- File a bug: https://github.com/openclaw/openclaw/issues
Include:
- the two versions above
- that
claude setup-tokennow returns a token withoutsk-ant-oat01- - paste the
claude setup-token --helpoutput (what you posted is perfect) - optional but helpful: the first 6–10 characters only of the generated token + total length (don’t post the full token)