Error reference
Anthropic billing and quota errors The answers Anthropic gives when an organization cannot pay for a request, and the ones that look similar but are not about money. For each: the status, the body, and what keyover does with it.
Rejections about money or the key 400Your credit balance is too low to access the Anthropic APIMoves to the next key: out of credit
A 400, not a 402: code that treats every 400 as a bad request leaves a working spare unused.
{
"type" : "error" ,
"error" : {
"type" : "invalid_request_error" ,
"message" : "Your credit balance is too low to access the Anthropic API. Please go to Plans & Billing to upgrade or purchase credits."
}
} Reported in the field: github.com . The body shows the fields the source establishes.
402An issue with your billing or payment informationMoves to the next key: out of credit
{
"type" : "error" ,
"error" : {
"type" : "billing_error"
}
} Documented by Anthropic: platform.claude.com . The body shows the fields the source establishes.
400You have reached your specified API usage limitsMoves to the next key: your own spend limit
{
"type" : "error" ,
"error" : {
"type" : "invalid_request_error" ,
"message" : "You have reached your specified API usage limits."
}
} Documented by Anthropic: platform.claude.com . The body shows the fields the source establishes.
400You have reached your specified workspace API usage limitsMoves to the next key: your own spend limit
{
"type" : "error" ,
"error" : {
"type" : "invalid_request_error" ,
"message" : "You have reached your specified workspace API usage limits."
}
} Documented by Anthropic: platform.claude.com . The body shows the fields the source establishes.
429Organization crossed its usage tier's monthly spend capStays by default: a cap the provider assigned
Anthropic assigns this cap. The pool does not move a request for it unless failoverOn includes provider_limit.
{
"type" : "error" ,
"error" : {
"type" : "rate_limit_error" ,
"details" : {
"error_code" : "enforced_spend_limit_reached"
}
}
} Documented by Anthropic: platform.claude.com . The body shows the fields the source establishes.
401API key is malformed, revoked or expiredMoves to the next key: key not accepted
{
"type" : "error" ,
"error" : {
"type" : "authentication_error"
}
} Documented by Anthropic: platform.claude.com . The body shows the fields the source establishes.
Answers that are not a reason to change key 403A billing_error type on a status the reference does not give itStays with your SDK
The reference pairs billing_error with 402 only.
{
"type" : "error" ,
"error" : {
"type" : "billing_error"
}
} Documented by Anthropic: platform.claude.com . The body shows the fields the source establishes.
401CORS requests are not allowed for this OrganizationStays with your SDK
Not a problem with the key. Send the request from a server.
{
"type" : "error" ,
"error" : {
"type" : "authentication_error" ,
"message" : "CORS requests are not allowed for this Organization"
}
} Documented by Anthropic: platform.claude.com . The body shows the fields the source establishes.
400Organization is on holdStays with your SDK
A trust and safety decision. Never routed around.
{
"type" : "error" ,
"error" : {
"type" : "invalid_request_error" ,
"details" : {
"error_code" : "organization_on_hold"
}
}
} Documented by Anthropic: platform.claude.com . The body shows the fields the source establishes.
429Rate limitStays with your SDK
A traffic control. Your SDK retries it. A Claude Code workspace limit looks the same and passes too.
{
"type" : "error" ,
"error" : {
"type" : "rate_limit_error"
}
} Sent with the header retry-after: 12.
Documented by Anthropic: platform.claude.com . The body shows the fields the source establishes.
429Usage increased too quicklyStays with your SDK
A traffic control. Your SDK retries it.
{
"type" : "error" ,
"error" : {
"type" : "rate_limit_error" ,
"details" : {
"error_code" : "ramp_limit_exceeded"
}
}
} Documented by Anthropic: platform.claude.com . The body shows the fields the source establishes.
529The API is temporarily overloadedStays with your SDK
It may have started work. A resend on another key could run it twice.
{
"type" : "error" ,
"error" : {
"type" : "overloaded_error"
}
} Documented by Anthropic: platform.claude.com . The body shows the fields the source establishes.
Keep serving through it Give the pool a second key that bills another organization you are authorized to use. When Anthropic refuses the first for one of the rejections above, the same request is sent again on the second, inside the same call. Your code gets a normal response, and an event tells you which organization needs attention.
import Anthropic from "@anthropic-ai/sdk"
import { ANTHROPIC , createKeyPool } from "keyover"
const pool = createKeyPool ({
provider : ANTHROPIC ,
keys : {
primary : process . env . ANTHROPIC_API_KEY ,
spare : process . env . ANTHROPIC_API_KEY_SPARE ,
} ,
})
const anthropic = new Anthropic ( pool .clientOptions)
const message = await anthropic . messages .create ({
model : "claude-haiku-5-5" ,
max_tokens : 128 ,
messages : [{ role : "user" , content : "Say hello." }] ,
})
console .log ( message .content) See it fail over in the playground , or read the README .
OpenAI Gemini API OpenRouter Groq DeepSeek Mistral Together AI Fireworks AI Cerebras