Error format
Prism returns an OpenAI-compatible error envelope:retryable as the primary retry signal, follow fix, and
respect Retry-After. Do not retry an unchanged request when retryable is
false.
Status codes
Rate limits
When a key is rate-limited, the API returns429 with Retry-After. Retry
after that interval. The header is seconds; the example below is a response
shape, not a published quota.
Retry-After is missing, use exponential backoff with jitter. Immediate
retries add load and usually fail again. Cap the number of attempts and surface
the final error to the caller.
Retry policy
Retry408, 429, 500, 502, 503, and 504 when the request is safe to
repeat. Do not retry other 4xx responses until you change the request or
credential.
For streaming requests, distinguish between:
- A connection that failed before any content was consumed. Retrying is usually safe.
- A connection that failed after partial content was consumed. Treat the partial generation as interrupted or begin a new turn. Do not silently append a retry to it.
Common fixes
Log the request ID from response headers when reporting a persistent server
error. Never log the API key or full prompts containing secrets.