code to describe request outcomes. Use the HTTP status to decide whether to retry, fix input, or treat a request as successful; use code to branch on the specific failure reason. The error field is still returned for older clients.
Common status codes
Error response format
Every error body includes a machine-readablecode and a sanitized human-readable message. Most responses also include error as a legacy compatibility field. New integrations should branch on code; older clients may continue reading error.
Generation error codes
Generation endpoints return error codes from one of three families, matching the endpoint’s output type. Every family shares the same set of sub-codes.Image generation
Returned byPOST /generation/{provider}/{model} (and the SSE variant) when the model is an image model.
IMAGE_GENERATION_FAILEDIMAGE_GENERATION_TIMEOUTIMAGE_GENERATION_RATE_LIMITEDIMAGE_GENERATION_PROVIDER_UNAVAILABLEIMAGE_GENERATION_UNSUPPORTED_MODELIMAGE_GENERATION_INVALID_INPUTIMAGE_GENERATION_INSUFFICIENT_CREDITSIMAGE_GENERATION_CONTENT_REJECTED
Video generation
Returned byPOST /generation/{provider}/{model} (and the SSE variant) when the model is a video model.
VIDEO_GENERATION_FAILEDVIDEO_GENERATION_TIMEOUTVIDEO_GENERATION_RATE_LIMITEDVIDEO_GENERATION_PROVIDER_UNAVAILABLEVIDEO_GENERATION_UNSUPPORTED_MODELVIDEO_GENERATION_INVALID_INPUTVIDEO_GENERATION_INSUFFICIENT_CREDITSVIDEO_GENERATION_CONTENT_REJECTED
TTS generation
Returned byPOST /ai/tts/generate and by POST /generation/{provider}/{model} (and the SSE variant) when the model is a TTS model. Workspace credit errors apply only to workspace-backed /generation endpoints.
TTS_GENERATION_FAILEDTTS_GENERATION_TIMEOUTTTS_GENERATION_RATE_LIMITEDTTS_GENERATION_PROVIDER_UNAVAILABLETTS_GENERATION_UNSUPPORTED_MODELTTS_GENERATION_INVALID_INPUTTTS_GENERATION_INSUFFICIENT_CREDITSTTS_GENERATION_CONTENT_REJECTED