Errors and Status Codes
Every EmpirioLabs API endpoint returns standard HTTP status codes with an OpenAI-compatible error body. This page explains the status codes you may see and how to handle each one.
Error response shape
A failed request returns a JSON body with an error object:
Every response also includes an x-request-id header. Include that value when you contact support so we can locate the exact request.
Status codes
Content moderation: 400 versus 422
Content-policy rejections return one of two status codes, and the difference is whether any generation actually ran:
- 400: the prompt was blocked before generation. Nothing was produced, so the request is not billed. Revise the prompt and try again.
- 422: media was generated and then blocked by the output content check. Because the generation ran, the request is billed at the normal rate for that model.
In both cases the message is generic (“This request violates our content policy and could not be completed. Please revise your prompt and try again.”) and does not name a provider. Revise your input to continue.
Retrying safely
- Retry
429and5xxresponses with exponential backoff and jitter. - Do not blindly retry
400,401,402, or422. They will keep failing until you change the request, key, balance, or input. - Async media jobs are durable. If a poll returns a transient error, keep polling the same
job_idinstead of resubmitting, so you are not charged twice.
For rate-limit details see Limits and API Keys. For key format and bearer-token setup see Authentication.
