Anthropic APIRunbook 0/2 done
invalid_request_error
Anthropic API Error invalid_request_error: Prompt is too long
Error✕ Not retryable · fix the payloadHTTP 400 Bad RequestAI Provider
TL;DR · 10-second read
The prompt plus requested output exceeds the model’s context window. Trim history, summarize old turns or retrieve only the relevant chunks; retrying the same request always fails.
Identify: does your log match?
What you see · exact log / response
anthropic.BadRequestError: Error code: 400 - {"type": "error", "error": {"type": "invalid_request_error", "message": "prompt is too long: 215337 tokens > 200000 maximum"}}Fix
Being written
Copy-paste fixes for invalid_request_error are in the enrichment queue
The summary above is verified. Paste your full trace into the decoder for a diagnosis now.
Open the decoder →Related errors
Last verified 2026-10-22 · Source: Anthropic API error reference + SDK docs · Official docs ↗ · ~4,400 searches/mo