Skip to content

[Bug]: Anthropic API works via direct /v1/messages call, but OpenClaw 2026.3.2 classifies provider as billing issue #38465

@vactorlsh

Description

@vactorlsh

Bug type

Regression (worked before, now fails)

Summary

T

Image Image Image

ext
Environment

  • OpenClaw version: 2026.3.2
  • Platform: Windows 11 + WSL2 Ubuntu
  • Provider: Anthropic
  • Model tested in OpenClaw: anthropic/claude-sonnet-4-6
  • Auth method: ANTHROPIC_API_KEY via environment variable

Problem
OpenClaw consistently fails before reply with:

All models failed (1): anthropic/claude-sonnet-4-6: Provider anthropic has billing issue (skipping all models) (billing)

However, Anthropic billing is active and direct API calls succeed.

What I verified

  1. Anthropic Console has active credit balance ($50).
  2. Claude Workbench usage is consuming tokens successfully.
  3. Anthropic Models API works with the same API key.
  4. Anthropic Messages API works with the same API key and model.

Direct API reproduction (works)

curl https://api.anthropic.com/v1/messages \
  -H "content-type: application/json" \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 64,
    "messages": [
      {"role": "user", "content": "Reply with only OK."}
    ]
  }'

Response:

{"model":"claude-sonnet-4-6", ... "content":[{"type":"text","text":"OK."}], ...}

Models API reproduction (works)

curl https://api.anthropic.com/v1/models \
  --header "x-api-key: $ANTHROPIC_API_KEY" \
  --header "anthropic-version: 2023-06-01"

Returned models include:

  • claude-sonnet-4-6
  • claude-opus-4-6
  • claude-opus-4-5-20251101
  • claude-haiku-4-5-20251001
  • claude-sonnet-4-5-20250929
  • claude-opus-4-1-20250805
  • claude-opus-4-20250514
  • claude-sonnet-4-20250514

OpenClaw config
Only Anthropic was left enabled during final testing.

"agents": {
  "defaults": {
    "model": {
      "primary": "anthropic/claude-sonnet-4-6"
    },
    "models": {
      "anthropic/claude-sonnet-4-6": {}
    }
  }
}

Notes

  • I also cleared old Anthropic auth state locally and restarted the gateway.
  • I removed OpenAI fallback during testing to isolate the issue.
  • openclaw update did not change version (before: 2026.3.2, after: 2026.3.2).

Expected behavior
OpenClaw should successfully use Anthropic with this API key, or surface the raw provider error if the request actually failed.

Actual behavior
OpenClaw classifies Anthropic as a billing issue and skips the provider, even though direct Anthropic API calls succeed with the same key.

Possible cause
This looks like an Anthropic error classification / cooldown / billing misclassification issue in OpenClaw rather than an actual provider billing failure.

Happy to provide more logs if there is a recommended debug flag to expose the raw Anthropic error payload before OpenClaw maps it to billing.

Steps to reproduce

  1. Set up OpenClaw 2026.3.2 on Windows 11 + WSL2 Ubuntu.
  2. Configure Anthropic as the only provider with:
    • primary model: anthropic/claude-sonnet-4-6
    • ANTHROPIC_API_KEY set via environment variable
  3. Start the gateway with:
    openclaw gateway run
  4. Open the OpenClaw Dashboard and send a simple message such as:
    test
  5. Observe that OpenClaw fails with:
    Provider anthropic has billing issue (skipping all models) (billing)
  6. Using the same ANTHROPIC_API_KEY, call Anthropic directly:
    • GET /v1/models
    • POST /v1/messages
  7. Observe that both direct Anthropic API calls succeed, including a successful response from claude-sonnet-4-6.

Expected behavior

OpenClaw should successfully use Anthropic with this API key, or surface the raw provider error if the request actually failed.

Actual behavior

OpenClaw classifies Anthropic as a billing issue and skips the provider, even though direct Anthropic API calls succeed with the same key.

OpenClaw version

2026.3.2

Operating system

Windows 11 + WSL2 Ubuntu

Install method

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions