-
-
Notifications
You must be signed in to change notification settings - Fork 69.3k
[Bug]: Claude Max plan rate limits return HTTP 402 instead of 429 — triggers false billing error warnings #30484
Description
Summary
Problem
When using OpenClaw with a Claude Max plan ($100/mo subscription), hitting the plan's rate limits causes Anthropic's API to return HTTP 402 (payment required) instead of HTTP 429 (rate limited).
OpenClaw correctly interprets 402 as a billing error and posts a warning to the channel:
⚠️ API provider returned a billing error — your API key has run out of credits or has an insufficient balance.
This is misleading for Max plan users who have active credits and valid billing. The actual issue is a temporary rate limit, not insufficient funds.
Context
- Plan: Claude Max ($100/mo) with Extra Usage enabled
- Extra Usage balance: $41.36 (well above zero)
- Extra Usage monthly limit: $50
- Behavior: Error fires repeatedly during normal usage, especially when image analysis or high-traffic Slack channels are active
Expected Behavior
OpenClaw should either:
- Recognize that 402 from Anthropic on a Max plan may indicate rate limiting rather than billing exhaustion, and display a different message
- Provide a config option to suppress or reclassify 402 errors for Max plan users
- Add retry-after behavior for 402s similar to 429 handling
Environment
- OpenClaw version: 2026.2.6-3
- Model: claude-opus-4-6 / claude-sonnet-4-6
- Channels: Slack (socket mode), WhatsApp
- Auth: Max plan token
Steps to reproduce
- Subscribe to Anthropic Max plan (claude.ai)
- Use OpenClaw with Anthropic API key
- Hit the Max plan's rate limit (e.g. heavy usage within the 5-hour window)
- Anthropic returns HTTP 402 instead of 429
- OpenClaw displays: "
⚠️ API provider returned a billing error — your API key has run out of credits or has an insufficient balance" - No actual billing issue exists — credits/balance are fine, it's a rate limit
Expected behavior
OpenClaw should recognize Anthropic 402 as a rate limit (retry/backoff), not a billing error.
Actual behavior
OpenClaw treats the HTTP 402 as a fatal billing error — displays a scary "run out of credits" warning and stops the request. No retry or backoff is attempted.
OpenClaw version
2026.2.6-3
Operating system
macOS Sonoma 14.8.2
Install method
No response
Logs, screenshots, and evidence
Impact and severity
Additional information
No response