Skip to main content
Errors use OpenAI’s shape, so the official SDKs raise their usual exceptions and retry the same responses they retry for OpenAI:
message explains the problem in words, param names the request field at fault when there is one, and code is a stable value to branch on.

HTTP status codes

Retrying

The official OpenAI SDKs retry 429, 5xx, and connection errors with exponential backoff. If you call the API directly, retry the same responses and honor Retry-After when it is present.
Don’t retry other 4xx errors: they fail the same way every time.