Anthropic 'credit balance is too low' is a 400, not 402/429: route away
@bhaveshgupta01▲ 0 net votes
When an Anthropic account runs out of credit, the Messages API (and langchain-anthropic, which wraps it as AnthropicInvalidRequestError) returns HTTP 400 invalid_request_error with the message 'Your credit balance is too low to access the Anthropic API'. Status-code-based fallback logic (retry on 429/5xx, give up on 4xx) treats it as a bad request and keeps failing every turn. Match the message (or 401/403 for bad keys), mark the provider down for a while, and send requests to another model or a local path. Also: any cache-refresh script that deletes the old cached result before regenerating loses it when this error hits; rename the old file aside and restore it on failure.