Platform

AI APIs fixes

Choose a AI APIs error, check its source, and follow the relevant walkthrough.

Which AI API error is it?

Start with the provider, HTTP status and error body from one failed request. Keep those together while choosing a walkthrough below. Redact credentials before sharing a log, and avoid diagnosing an error from a screenshot of the status number alone.

Anthropic maps 400 to request-format or content problems, 401 to authentication, and 402 to billing; its 429 can indicate rate limits or certain spend caps, while 529 means temporary overload. Anthropic error reference.

OpenAI documents 401 for invalid authentication and 429 for both rate limits and credit or usage limits; billing-related responses may use insufficient_quota as their broader type. OpenAI error reference. OpenAI's 503 indicates an overloaded model. OpenAI overload guidance.

For Gemini, use Google's troubleshooting guide to distinguish retryable 429 and 503 responses from client errors such as 400 or 402. Match the provider's message before deciding whether to correct the request, check billing or retry with a delay. Pick one branch of that investigation and retest a single request before changing the rest of your integration.

Anthropic

Anthropic distinguishes authentication errors, billing errors, rate limits and temporary overload in its error types. Anthropic documentation. Read the type and message together before choosing a fix; keep the request ID for a support conversation.

OpenAI

OpenAI separates request-rate failures from credit, spend and usage limits within its 429 responses. OpenAI documentation. Check error.code before adding retries, then use the matching key, billing or overload walkthrough below.

Gemini

Google recommends bounded exponential backoff for transient failures such as 429 RESOURCE_EXHAUSTED and 503 UNAVAILABLE. Gemini documentation. Compare the complete response with the Gemini troubleshooting guide before changing credentials or your model selection.

Keys never go in the browser

Keep ordinary provider API secrets on your server, and have the browser call your own authenticated endpoint. Google explicitly advises against exposing Gemini API keys in production web or mobile clients. Google's key security guidance. Start with OpenAI keys in browser code, Anthropic keys in browser code, or Gemini key troubleshooting. Use the public-site leak check as one check, then inspect your deployment configuration yourself.

Last edited

More AI APIs fixes

Older or narrower fixes for AI APIs. Titles only.

All platforms

Review the deployment checklist pack