Fix AI API & Tooling Errors

Step-by-step fixes for the errors developers actually hit with Claude, OpenAI, Cursor, and GitHub Copilot — what each error means, the most common causes in order, and exactly how to resolve it.

Anthropic API authentication_error (HTTP 401)
Claude API returning 401 with authentication_error? Here are the 6 most common causes — wrong env var,…
Claude API 401 Unauthorized (authentication_error)
Getting a 401 from the Anthropic Claude API? Here are the 5 causes in diagnostic order — bad key,…
Claude API "overloaded_error" (HTTP 529)
The Claude API 529 overloaded_error means Anthropic's API is temporarily overloaded. Here's what…
Claude Code "command not found"
Terminal returning 'claude: command not found' after installing Claude Code? Here are the 4 causes in…
Claude Code Permission Denied
Claude Code returning 'permission denied' or refusing to read/write files? Here are the 4 causes in…
Cursor Authentication Failed
Cursor showing 'Authentication failed' or logged out unexpectedly? Here are the 5 causes in diagnostic…
Cursor Rate Limit Exceeded
Cursor showing 'Rate limit exceeded' or 'Too many requests'? Here are the 4 causes in diagnostic order —…
GitHub Copilot Not Showing in VS Code
GitHub Copilot not appearing in VS Code? Inline suggestions gone or Copilot Chat missing? Here are 6…
OpenAI API 429 Error
A 429 error from the OpenAI API has two completely different causes: a rate limit (too fast) or…
OpenAI API 500 Internal Server Error
OpenAI API 500 errors are server-side and not your fault — but here's how to distinguish 500 from…
OpenAI API Timeout Errors — Connection vs. Read Timeout & Fixes (2026)
Fix OpenAI API timeout errors in Python. Covers connection timeouts vs. read timeouts, how to configure…
OpenAI context_length_exceeded (HTTP 400)
OpenAI 400 context_length_exceeded means your input tokens exceed the model's context window. Here's how…
OpenAI "Insufficient Quota" Error
OpenAI API returning 'You exceeded your current quota'? Here are 4 causes in diagnostic order — no…
OpenAI "Invalid API Key" (AuthenticationError / HTTP 401)
Getting AuthenticationError or HTTP 401 from the OpenAI API? Here are the 6 most common causes in…
OpenAI "Model Not Found" Error — 3 Causes & Exact Fixes (2026)
Fix the OpenAI model_not_found error. Three distinct causes: wrong model ID string, no access to that…
Anthropic API permission_error (HTTP 403)
Getting a 403 permission_error from the Anthropic API? Here are the 5 causes in diagnostic order — model tier access, beta feature headers,…
Claude Code "API key not configured"
Getting 'API key not configured' or authentication errors in Claude Code? Here are the 5 causes in diagnostic order — ANTHROPIC_API_KEY not set,…
LangChain Anthropic Authentication Error
Getting authentication errors with LangChain and Anthropic Claude? Here are the 5 causes in diagnostic order — wrong env var name, package mismatch,…
OpenAI API "No Such Organization" Error
Getting 'No such organization' from the OpenAI API? Here are the 5 causes in diagnostic order — wrong org ID, key not in org, org deactivated,…
Genspark "Context Length Exceeded"
Getting 'context length exceeded, please open a new session' in Genspark? Here's why it happens and the 4-step fix — when to start a new session,…
Gemini API 429 RESOURCE_EXHAUSTED
Gemini API returning 429? Here's how to read the quotaMetric, back off correctly, and raise your limits.
OpenAI "Invalid schema for response_format" (400)
Structured Outputs rejects your JSON Schema: set additionalProperties false on every object and list every property as required.
OpenAI status "incomplete": max_output_tokens
Empty output_text from a reasoning model? The response hit its output cap. Not an exception — check status and raise max_output_tokens.
Anthropic API 429 rate_limit_error: rate limit or spend cap?
One error type, three causes. Check retry-after and error.details.error_code before retrying; the SDK retries a spend-cap 429 anyway.
Anthropic "Streaming is required" ValueError
Client-side SDK check: non-streaming calls with max_tokens above 21,333 raise before sending. Stream it or set a timeout.
Claude Code: response exceeded the output token maximum
Two documented variants: one you can raise with CLAUDE_CODE_MAX_OUTPUT_TOKENS (capped per model), one fixed at 64000 that you cannot.
Claude Code "Prompt is too long" / Context limit reached
Every documented variant of the error and the official fix order: /compact, /clear, /context, MCP servers, CLAUDE.md, gateway model IDs.
GitHub Copilot "Sorry, you have been rate-limited"
The Copilot Chat rate-limit message traced to its source, GitHub's documented fix path, and how it differs from running out of AI credits.
Cursor "Connection failed" — check your internet or VPN
Cursor's documented fix path: Run Diagnostics, HTTP/1.1 mode, domain allowlist and curl proxy tests. Error wording is user-reported.
Gemini API "API key not valid" (400 API_KEY_INVALID)
Reproduced live: bad key returns 400, missing key 403, Bearer 401. Plus the env var precedence and quoted-key mistakes in google-genai.
Gemini API 403 PERMISSION_DENIED: project denied access
Which documented project state is behind the 403 (verification, free tier, payment, blocked key, suspension) and Google's fix for each.