#Error API

1 messages · Page 1 of 1 (latest)

south domeBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

uncut tuskBOT
#

That warning is OpenClaw rewriting the provider’s raw error (anything that looks like 402, “plans & billing”, “insufficient credits”, etc). So it can show up even when your balance looks fine.

Two common causes:

  1. You’re looking at the wrong “credits”
  • ChatGPT / Claude subscription ≠ API billing credits (for OpenAI/Anthropic API keys).
  • Some providers have separate orgs/projects; a key tied to a project with no billing will still throw “check plan and billing”.
  1. OpenClaw has temporarily disabled your auth profile after a billing-looking error
    After a billing/credit failure, OpenClaw marks that profile as disabled for a backoff window (defaults: ~5h, can grow up to 24h). Even if you top up, it may keep skipping that profile until disabledUntil passes.
    Docs: https://docs.openclaw.ai/concepts/model-failover#billing-disables

What I need from you (safe to paste; it redacts secrets):

openclaw --version
#
openclaw status --all
openclaw models status --json

In the models status --json output, look for auth.unusableProfiles and see if you have something like disabled:billing (and a disabledUntil timestamp).

Also tell me which provider you’re using (OpenAI API key vs OpenAI Codex OAuth vs Anthropic key/setup-token vs OpenRouter/etc).

If it is disabled:billing, the fastest fixes are:

  • add/switch to a different auth profile/key that’s billed correctly, then /new (session sticks to previous profile choices), or
  • wait until disabledUntil expires.
uncut tuskBOT
#

That message is OpenClaw surfacing the provider’s “payment_required / insufficient_quota / billing_error”-style response. When people “definitely have credits”, it’s almost always one of these:

  1. Gateway is using a different credential than you think (stale key in auth store, different agent, or service env not picking up your new key)
  2. Key is in the wrong Anthropic org / workspace, or the org has a $0 spend limit / hard limit hit
  3. You’re using a Claude subscription token but expecting it to behave like API billing (or the token was revoked)

To pinpoint which one, can you paste the output of these 4 commands?

openclaw --version
openclaw gateway status
openclaw models status
openclaw logs --limit 200

What I’m looking for:

#
  • openclaw gateway status: do Config (cli) and Config (service) match? If they don’t, you’re editing one config but the LaunchAgent/service is running another (common cause of “no matter what I change”).
  • openclaw models status: which Anthropic auth profile is actually selected + what error it reports for that profile.
  • openclaw logs: the real provider error JSON (OpenClaw’s chat message is intentionally generic).

Also (macOS gotcha): if you set ANTHROPIC_API_KEY only in your shell, the service won’t inherit it. Fix is to put it in ~/.openclaw/.env (or configure env import), then restart the gateway. Docs: https://docs.openclaw.ai/help/faq#i-started-the-gateway-via-the-service-and-my-env-vars-disappeared-what-now

Once you paste those outputs, I can tell you exactly whether this is “wrong key”, “wrong org/spend cap”, or “service using different config/auth”.

#

That snippet is the smoking gun: you currently have two Anthropic credentials in play:

  • anthropic:default → type: "api_key" (stored)
  • anthropic:manual → type: "token" (stored)
  • plus an ANTHROPIC_API_KEY coming from your shell env

OpenClaw will rotate auth profiles within a provider, and it also tends to try the “OAuth/token-like” profiles before plain API keys (and it pins whatever it picked for the current session). So it’s very easy to be “sure my key has credits” while the Gateway is actually using the other profile that’s billing-error’ing.

Fastest fix (force it to use your API key profile)

Run:

openclaw models auth order set --provider anthropic anthropic:default

Then start a fresh chat session (important, because of auth pinning):

#
  • send /new in the chat where you see the billing error
  • try again

(If you have multiple agents, add --agent main or whichever agent is active.)

Quick confirmation (so we know which credential is failing)

Please paste the output of:

openclaw models auth order get --provider anthropic
openclaw models status --probe-provider anthropic --probe

--probe will show which specific profile is returning the billing error.

If it still fails even on anthropic:default

Then it’s not an OpenClaw rotation issue — it’s usually Anthropic org/project mismatch or spend cap on the API side (the key belongs to a different org/project than the one where you “see credits”, or there’s a $0/hard limit set).

#

Yep — that output confirms you still have two Anthropic auth profiles (anthropic:default API key + anthropic:manual token). In that setup OpenClaw can easily end up using the token profile (and then you’ll keep seeing “billing error” even though your API key has credits).

Do this to force Anthropic to use the API key profile:

openclaw models auth order set --provider anthropic anthropic:default

Then in the chat where it’s failing, start a fresh session (auth is session-pinned):

  • send /new
  • try again

After that, please paste these two command outputs so we can verify it’s actually probing the right profile:

#
openclaw models auth order get --provider anthropic
openclaw models status --probe-provider anthropic --probe --json

If it still billing-errors while probing anthropic:default, then the key itself is being rejected for billing on Anthropic’s side (usually org/project mismatch or a spend cap), and the probe output/log tail will show the exact Anthropic error code/message.

#

Nothing in what you pasted so far looks immediately usable to take over your OpenClaw (no full gateway token, no full Anthropic key, no session creds).

What did leak / is mildly sensitive:

  • Your local macOS username + paths (/Users/alfredblevins/...). That’s mostly privacy, not account compromise.
  • A partial Anthropic key string: sk-ant-a...oSbU4gAA
    By itself, a fragment like that is not enough to authenticate (they need the full key). But as a best practice, if you’re not 100% sure you never pasted the full key elsewhere in the thread, treat it as compromised.

What I’d do now (quick + safe):

  1. Delete/edit any message that contains any part of the key (Discord lets you delete your own messages).
  2. Rotate the Anthropic API key in the Anthropic Console (create a new one, revoke the old).
  3. Restart the gateway after updating the key so you’re sure the running service picked it up.

If you want, paste a fresh openclaw status --all after rotation — it’s designed to be shareable and redacts tokens.

#

If you want Claude Max (setup-token) only and never your Anthropic API key, do two things:

1) Force the Anthropic auth profile order to ONLY the token profile

Run:

openclaw models auth order set --provider anthropic anthropic:manual

Then start a fresh session in chat (auth is session-pinned):

  • send /new

2) Remove/disable all API-key sources so it can’t “accidentally” pick them

Even with auth order set, it’s smart to remove the other sources:

  • Unset ANTHROPIC_API_KEY wherever it’s being loaded from:
#
  • your shell env

    • ~/.openclaw/.env (common on macOS services)
    • any env: { ANTHROPIC_API_KEY: ... } block in openclaw.json
  • Optional but “hard guarantee”: delete the anthropic:default api_key entry from:

    ~/.openclaw/agents/main/agent/auth-profiles.json
    

    (make a backup copy first)

Restart the gateway after changing env/files.

Verify it’s really using the Max token

openclaw models status --probe-provider anthropic --probe-profile anthropic:manual --probe