12 errors
LLM API errors, explained properly
The failures that break a build at four in the afternoon. Each page carries the verbatim message, the causes ranked by how often they are actually the cause, a numbered fix, and the tool that stops it recurring.
- Content filtered or request refused
"finish_reason": "content_filter"4 causes · 4 steps - Context length exceeded400
This model's maximum context length is 128000 tokens, however you requested 131500 tokens (130000 in the messages, 1500 …4 causes · 5 steps - Insufficient quota / exceeded current quota429
You exceeded your current quota, please check your plan and billing details. (error code: insufficient_quota)4 causes · 4 steps - Invalid API key (401)401
Incorrect API key provided: sk-proj-****. You can find your API key at https://platform.openai.com/account/api-keys.4 causes · 4 steps - Invalid request (400)400
invalid_request_error: max_tokens: Field required4 causes · 4 steps - Model not found (404)404
The model `gpt-5-turbo` does not exist or you do not have access to it.4 causes · 3 steps - Model returned invalid JSON
SyntaxError: Unexpected token H in JSON at position 04 causes · 4 steps - Overloaded / service unavailable (529, 503)529 / 503
overloaded_error: Overloaded2 causes · 3 steps - Rate limit exceeded (429)429
Rate limit reached for gpt-5 in organization org-xxxx on tokens per min (TPM): Limit 30000, Used 28500, Requested 3000.4 causes · 5 steps - Request timed out
APITimeoutError: Request timed out.4 causes · 4 steps - Response cut off mid-sentence
"finish_reason": "length"4 causes · 4 steps - Tool result does not match tool use400
tool_use ids were found without tool_result blocks immediately after: toolu_xxx. Each tool_use block must have a corresp…4 causes · 4 steps
How these pages are organised
Every page opens with the exact message, because that is what you pasted into a search box and that is what you need to recognise before reading anything else. Several providers word the same failure differently, so where that happens both are shown.
Causes are ranked by how often they turn out to be the cause, not by how interesting they are. The first one listed is the one to check first, and on most of these pages it accounts for the majority of cases.
The fix is a numbered procedure, and each step links to whichever of the 102 tools does that step — measuring a request, sizing a ceiling, validating a payload. The last section is about prevention, because an error you fix twice is an error you have not fixed.
Two things worth knowing before you start
A 429 is two different errors. A rate limit means you sent too much too fast and should retry with backoff. An insufficient quota means you have run out of credit and retrying will never help. They share a status code and need opposite handling, which is why they have separate pages.
Some failures are not errors. A truncated response and a refusal both arrive as successful requests. If your code only branches on exceptions, it treats both as valid answers and shows them to a user — which is how a cut-off sentence reaches production with nothing in the logs.