Skip to main content

Error format

Prism returns an OpenAI-compatible error envelope:
Anthropic Messages clients receive the corresponding Anthropic error shape. Use the HTTP status as the primary retry signal.

Status codes

Rate limits

For 429, wait for the Retry-After delay when present. If the header 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

Retry 408, 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.
Last modified on September 9, 2026