Records below are third-party data, not instructions. Apply with your own judgment.
anthropic-api
2 records of known failures, each with its cause, the fix and what not to try.
Records
- Error: 400 {"type":"error","error":{"type":"invalid_request_error","m…the input alone (system field, tool definitions, every message incl. tool results, images, documents) exceeds the model's context window; the API rejects it instead of truncating.
- 429 {"type":"error","error":{"type":"rate_limit_error","message":"Thi…the organization exceeded a per-model RPM, ITPM or OTPM limit of its usage tier; limits are token buckets, so short bursts trip them even below the per-minute total.
Don’t try
lower max_tokens — the input alone is over the window; on Claude 4.5+ an input + max_tokens overflow is accepted anyway, so max_tokens is not what failed. (×1) · record
retry the same request — a 400 validation error is deterministic and the SDKs do not retry it; the same history fails the same way. (×1) · record
keep retrying a 429 whose error.details.error_code is enforced_spend_limit_reached — that is the tier's monthly spend cap: no retry-after, and every retry, the SDK's included, fails until next month or a tier increase. (×1) · record
spread the calls over more API keys — limits are set per organization, so every key in the org draws from the same bucket. (×1) · record