Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Every request routed through OpenClaw's agent runtime — both Telegram channel messages and bare openclaw agent ... --local CLI calls — is rejected by Anthropic with:
{"type":"error","error":{"type":"invalid_request_error","message":"You're out of extra usage. Add more at claude.ai/settings/usage and keep going."}}
The same Anthropic account, called directly via Claude Code (claude -p "...", bypassing OpenClaw entirely), succeeds normally with no error. Anthropic's own usage dashboard for this account shows substantial headroom on every relevant metric at the time of failure. This points to something in OpenClaw's request shape (not account state, not token validity, not channel-specific metadata) triggering Anthropic's billing/overage classification.
Environment
- OpenClaw 2026.6.10 (aa69b12)
- macOS (Mac Mini), gateway running as a long-lived local service
- Anthropic auth: subscription via claude setup-token (token-mode profile, not API key)
- Single configured model: anthropic/claude-opus-4-8, single auth profile anthropic:default, no fallbacks configured
- Channel: Telegram (long-polling)
Steps to reproduce
- Authenticate OpenClaw's Anthropic profile via claude setup-token (subscription/Max-Pro token auth).
- Send a message through a connected channel (Telegram), or run:
bash openclaw agent --agent <agent-id> --message "test message" --local
- Observe the request fail with the invalid_request_error / "out of extra usage" message above.
- With the same Anthropic account, run Claude Code directly:
bash claude -p "test message"
- Observe this succeeds normally.
What's been ruled out
- Channel-metadata injection (the openclaw.inbound_meta.v1 schema string implicated in Claude CLI backend fails with billing error when system prompt contains openclaw.inbound_meta.v1 schema identifier #65399): ruled out — the bare --local embedded run, which carries no channel envelope, fails identically to the Telegram-routed run.
- Stale/cached auth-profile cooldown: ruled out — cleared the disabledUntil / disabledReason / errorCount / failureCounts / lastFailureAt fields directly from auth_profile_state in the agent's SQLite store, restarted the gateway, and the failure recurred on the next request.
- Stale or invalid token: ruled out — generated a brand-new token via claude setup-token, pasted it via openclaw models auth paste-token --provider anthropic --profile-id anthropic:default, restarted the gateway. Failure recurred with reused=false in the log (confirming OpenClaw treated it as a genuinely fresh failure, not cached state).
- Actual usage/credit exhaustion: ruled out via the Anthropic usage dashboard at time of failure:
- Current session: 12% used (resets in ~4.5h)
- Weekly, all models: 4% used
- Usage credits (overage): enabled, £0.12 of £15 monthly limit spent
Expected behavior
Requests made through OpenClaw's agent runtime, authenticated via a subscription setup-token, should draw against the same plan quota as interactive Claude Code sessions — consistent with what the account's own usage dashboard reports.
Actual behavior
All OpenClaw-routed requests (channel-originated and bare embedded/local) are rejected with Anthropic's overage-gate error, regardless of token freshness or cleared cooldown state, while the identical account succeeds via direct Claude Code CLI calls.
OpenClaw version
OpenClaw 2026.6.10 (aa69b12)
Operating system
macOS Tahoe 26.5.1 (Mac Mini), gateway running as a long-lived local service
Install method
No response
Model
anthropic/claude-opus-4-8
Provider / routing chain
Telegram (long-polling, no webhook) → OpenClaw Gateway (local mode, single instance, macOS) → embedded agent runtime → Anthropic API (model: anthropic/claude-opus-4-8, auth profile: anthropic:default, single profile, no fallbacks configured)
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Representative log output
[model-fallback/decision] model fallback decision: decision=probe_cooldown_candidate requested=anthropic/claude-opus-4-8 candidate=anthropic/claude-opus-4-8 reason=billing next=none
[agent/embedded] probing cooldowned auth profile for anthropic/claude-opus-4-8 due to billing unavailability
[agent/embedded] embedded run agent end: isError=true model=claude-opus-4-8 provider=anthropic error=LLM request failed: provider rejected the request schema or tool payload. rawError={"type":"error","error":{"type":"invalid_request_error","message":"You're out of extra usage. Add more at claude.ai/settings/usage and keep going."}}
[agent/embedded] auth profile failure state updated: provider=anthropic reason=billing window=disabled reused=false
[model-fallback/decision] model fallback decision: decision=candidate_failed requested=anthropic/claude-opus-4-8 candidate=anthropic/claude-opus-4-8 reason=billing providerErrorType=invalid_request_error
FailoverError: LLM request rejected: You're out of extra usage. Add more at claude.ai/settings/usage and keep going.Impact and severity
No response
Additional information
Is this an intentional Anthropic-side policy that routes orchestrator/agent-framework traffic through the "extra usage" billing gate separately from interactive Claude Code sessions on subscription plans — or a bug in how OpenClaw's embedded runtime shapes its request (system prompt structure, tool schema, or similar) that causes Anthropic to misclassify it? This mirrors an open question raised in #65399.
Possibly related
- Claude CLI backend fails with billing error when system prompt contains openclaw.inbound_meta.v1 schema identifier #65399 — Claude CLI backend fails with billing error when system prompt contains openclaw.inbound_meta.v1 schema identifier (that issue is scoped to channel messages specifically; this report shows the same error occurs even without channel routing involved)
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 26, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 26, 2026, 6:24 PM ET / 22:24 UTC.
Summary
Current main still supports Anthropic setup-token auth through the embedded Anthropic Messages API path, and the earlier inbound metadata fix does not cover the reporter's bare local embedded reproduction, so this should remain open for provider/auth investigation.
Reproducibility: yes. for the OpenClaw-side path: source and logs show setup-token credentials reach the Anthropic provider path and the exact error is classified as billing; no for the external rejection itself because live subscription credentials were unavailable.
Next step
Live Anthropic subscription-token behavior and the supported setup-token product promise need maintainer/provider judgment before a safe automated fix PR.
Review details
Best possible solution:
Keep the issue open until maintainers live-test setup-token behavior and either fix the supported request shape or narrow docs/setup toward Claude CLI or API-key use with explicit billing expectations.
Do we have a high-confidence way to reproduce the issue?
Yes for the OpenClaw-side path: source and logs show setup-token credentials reach the Anthropic provider path and the exact error is classified as billing; no for the external rejection itself because live subscription credentials were unavailable.
Is this the best way to solve the issue?
Unclear: the prior inbound-metadata schema rename does not cover this bare local embedded path, so maintainers must decide whether to repair the Anthropic setup-token request shape or steer users to Claude CLI/API-key paths.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against b3eee0374010.
Label changes
Label justifications:
P1: The report says every Anthropic setup-token embedded/channel turn fails, blocking real agent replies despite direct Claude CLI usage working.impact:message-loss: The failure prevents Telegram-routed and local embedded agent turns from producing replies.impact:auth-provider: The affected surface is Anthropic token auth, provider request shape, billing classification, and auth-profile cooldown handling.Evidence reviewed
Acceptance criteria:
openclaw agent --agent <agent-id> --message "test message" --localsmoke with an Anthropic setup-token profile and redacted request/error evidence.What I checked:
openclaw agent --localAnthropic setup-token requests failing with the sameout of extra usageresponse while directclaude -pworks; the existing ClawSweeper comment also keeps it open for live provider/auth follow-up.anthropic/claude-opus-4-8. (extensions/anthropic/register.runtime.ts:77, b3eee0374010)setRuntimeApiKey, while the stream wrapper injects the resolved API key into stream options for the provider call. (src/agents/embedded-agent-runner/run/auth-controller.ts:379, b3eee0374010)sk-ant-oatare sent as bearerauthTokenwith Claude Code identity headers through the Anthropic client, so the reported setup-token path still reaches the direct Messages API shape on main. (src/llm/providers/anthropic.ts:970, b3eee0374010)out of extra usagewording is classified as billing, matching the issue logs' cooldown/failover behavior rather than proving the provider rejection is fixed. (src/agents/embedded-agent-helpers/failover-matches.ts:216, b3eee0374010)openclaw.inbound_meta.v2, but this issue explicitly reproduces without a channel envelope. (src/auto-reply/reply/inbound-meta.ts:522, b3eee0374010)Likely related people:
extensions/anthropic/register.runtime.ts,docs/gateway/authentication.md,docs/concepts/model-providers.md)src/auto-reply/reply/inbound-meta.ts,src/auto-reply/reply/inbound-meta.test.ts)out of extra usageresponses as billing, which is central to this issue's cooldown/failover behavior. (role: billing classifier contributor; confidence: medium; commits: ad2df6354798; files:src/agents/embedded-agent-helpers/failover-matches.ts)src/agents/cli-runner/execute.ts,extensions/anthropic/cli-backend.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.donnagagent commentedon Jun 26, 2026
Update: ran two more isolation tests since filing.
Switched the model from
claude-opus-4-8toclaude-sonnet-4-6(nocontext1mparam configured on either) — identical failure. Rules out the model's default
1M context window as the cause.
Generated a fresh
claude setup-tokenand instead of feeding it to OpenClaw,exported it directly for Claude Code itself:
This succeeds normally — same exact credential, same account, no OpenClaw
in the path. Rules out the setup-token credential type itself as the cause.
So account state, token freshness, cooldown caching, two different models, and
the OAuth credential type are all ruled out. Whatever's left is specific to how
OpenClaw's embedded runtime constructs the request itself.
openclaw-barnacle commentedon Jul 11, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
openclaw-barnacle commentedon Jul 19, 2026
Closing due to inactivity.
If this is still an issue, please retry on the latest OpenClaw release and share updated details.
If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.