Skip to content

[Bug]: Embedded/channel agent runtime rejected with Anthropic "out of extra usage" billing error on subscription (setup-token) auth — reproducible outside channel routing, with confirmed account usage headroom #97108

Closed as not planned

Description

@donnagagent

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

  1. Authenticate OpenClaw's Anthropic profile via claude setup-token (subscription/Max-Pro token auth).
  2. Send a message through a connected channel (Telegram), or run:

bash openclaw agent --agent <agent-id> --message "test message" --local

  1. Observe the request fail with the invalid_request_error / "out of extra usage" message above.
  2. With the same Anthropic account, run Claude Code directly:

bash claude -p "test message"

  1. 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

Activity

  1. clawsweeper commented on Jun 26, 2026

    @clawsweeper
    Contributor

    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:

    • No live Anthropic subscription setup-token credential was available in this read-only review, so the upstream billing-gate response was not independently reproduced on current main.
    • The correct end state may be code, docs, or Anthropic policy clarification because current docs support setup-token but prefer Claude CLI reuse.

    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:

    • Run a live openclaw agent --agent <agent-id> --message "test message" --local smoke with an Anthropic setup-token profile and redacted request/error evidence.
    • Run the existing Anthropic setup-token live test or QA scenario when credentials are available.
    • If behavior or support policy changes, validate docs in docs/gateway/authentication.md, docs/concepts/model-providers.md, and docs/cli/models.md.

    What I checked:

    Likely related people:

    • Peter Steinberger: Restored the Anthropic setup-token flow and then changed guidance to prefer Claude CLI over setup-token in nearby auth/docs surfaces. (role: Anthropic setup-token/auth contributor; confidence: medium; commits: b4216d197d10, ac38f332c5c8; files: extensions/anthropic/register.runtime.ts, docs/gateway/authentication.md, docs/concepts/model-providers.md)
    • vincentkoc: Authored and merged the prior Claude CLI backend fails with billing error when system prompt contains openclaw.inbound_meta.v1 schema identifier #65399 inbound metadata fix that this issue distinguishes from the remaining setup-token embedded-runtime failure. (role: related fix author and merger; confidence: medium; commits: 6437aa8532f6; files: src/auto-reply/reply/inbound-meta.ts, src/auto-reply/reply/inbound-meta.test.ts)
    • neeravmakwana: Authored the merged fix that classifies Anthropic out of extra usage responses 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)
    • Alex Alaniz: Authored adjacent Claude CLI host-managed billing work around subscription-vs-extra-usage behavior for Anthropic orchestration. (role: adjacent subscription-billing contributor; confidence: low; commits: 6bd64ca4a7cf; files: src/agents/cli-runner/execute.ts, extensions/anthropic/cli-backend.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    on Jun 26, 2026
  3. donnagagent commented on Jun 26, 2026

    @donnagagent
    Author

    Update: ran two more isolation tests since filing.

    1. Switched the model from claude-opus-4-8 to claude-sonnet-4-6 (no context1m
      param configured on either) — identical failure. Rules out the model's default
      1M context window as the cause.

    2. Generated a fresh claude setup-token and instead of feeding it to OpenClaw,
      exported it directly for Claude Code itself:

      export CLAUDE_CODE_OAUTH_TOKEN="$(claude setup-token)"
      claude -p "test message"
      

      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.

  4. openclaw-barnacle commented on Jul 11, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  5. openclaw-barnacle commented on Jul 19, 2026

    @openclaw-barnacle

    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.

  6. locked as resolved and limited conversation to collaborators on Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions