Skip to main content
Check the HTTP status first, then read the error message in the response body. Error object shapes may differ between providers.

Retry guidelines

  • Do not automatically retry invalid requests, authentication failures, or oversized request bodies.
  • Use exponential backoff with jitter for 429, 502, 503, and 504 responses.
  • Confirm that a create endpoint supports idempotency before retrying it.
  • Log the request ID, status, model, and error message. Never log the API key.