AI API error 500: internal errors and bounded retries
A 500 indicates an internal server error on the responding endpoint. One failed request does not establish a global AI service outage.
Quick answer
A 500 indicates an internal server error on the responding endpoint. One failed request does not establish a global AI service outage.
Provider guidance
OpenAI documents 500 as a server-side error. Claude calls its 500 response api_error and recommends exponential backoff; persistent failures should be investigated with the request ID.
Gemini GenerateContent documents 500 INTERNAL as an internal error and lists an overly long input context as a possible cause. Interactions describes 500 with error.code=api_error. Preserve the endpoint and sanitized error details, check the request context, and use a bounded retry policy for transient failures.
Official SDKs can retry before your code sees an error. Claude’s official SDKs retry connection errors, rate limits and 5xx server errors twice by default with exponential backoff and honor retry-after when present. Gemini’s Python SDK retries timeouts, network issues, 429 and 5xx responses up to four times, with an initial delay of about 1 second and a maximum delay of 60 seconds.
Recommended application response
Verify which endpoint returned the response: a model provider, router, proxy or your own application. Save the request time, model, error type and request ID without secrets. Consult that service’s current report, including component scope and collection time.
Use a limited retry budget for a transient failure. Check whether your SDK already retried. Before repeating an interrupted operation, consider whether output, billing or downstream actions may already have occurred. A provider report does not confirm your individual request will succeed.
Related service pages
Each entry shows its own collection coverage. A linked service is not necessarily automatically collected.
Editorial review date applies to this guide. Live report collection times appear on the service pages.