-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
Anthropic API key fallback not triggered when subscription hits rate limit — both providers share cooldown bucket #30030
Description
Bug Report
Version: OpenClaw 2026.2.26 (bc50708)
Summary
When the Anthropic subscription (OAuth) hits rate limits, the configured API key fallback (anthropic-api/claude-opus-4-6) is never triggered. Instead, the gateway immediately returns All models failed (1) — meaning only 1 model was attempted despite a fallback being configured.
Config
{
"primary": "anthropic/claude-opus-4-6",
"fallbacks": ["anthropic-api/claude-opus-4-6"]
}Auth profiles:
anthropic:default→ provider:anthropic, mode:token(OAuth/subscription)anthropic:api→ provider:anthropic-api, mode:token(API key)
Error from gateway.log
Error: All models failed (1): anthropic/claude-opus-4-6: Provider anthropic is in cooldown (all profiles unavailable) (rate_limit)
Note: (1) — only 1 model tried, fallback never attempted.
Expected Behavior
When anthropic/claude-opus-4-6 hits a rate limit, the gateway should attempt anthropic-api/claude-opus-4-6 (API key, separate billing account) before failing.
Actual Behavior
Gateway puts the entire anthropic provider in cooldown and fails immediately. It appears anthropic and anthropic-api share the same cooldown bucket despite being configured as separate providers — so when one is rate limited, both are blocked.
Impact
The subscription and API key are on separate Anthropic accounts with independent rate limits. When the subscription is exhausted, the API key should absorb the load seamlessly. This defeats the entire purpose of configuring a fallback.
Workaround
None currently. Both providers fail simultaneously, leaving the agent completely unavailable until the cooldown expires.
Steps to Reproduce
- Configure primary as
anthropic/claude-opus-4-6, fallback asanthropic-api/claude-opus-4-6 - Trigger rate limit on subscription (run multiple parallel subagents)
- Observe
All models failed (1)despite fallback being configured