All errors use OpenAI’s envelope:
{ "error": { "message": "...", "type": "...", "code": "..." } }.400 — Bad request
Your request body is malformed, an unknown model was requested, or a required field is missing.message field is safe to surface in your UI.
401 — Unauthorized
Missing, malformed, or revoked API key.Authorization: Bearer sk-… header. If the key is correct, it may have been revoked — generate a new one from the dashboard.
402 — Payment required
Your key’s credit is exhausted.404 — Not found
Typically a stale model id or an unknown video job id.429 — Too many requests
You exceeded the per-key requests-per-minute ceiling. The response includes these headers:| Header | Meaning |
|---|---|
Retry-After | Seconds to wait before retrying. |
x-ratelimit-limit-requests | RPM ceiling. |
x-ratelimit-remaining-requests | Remaining in the current window. |
x-ratelimit-reset-requests | Unix timestamp when the window resets. |
Retry-After. If you consistently hit the ceiling, request a tier upgrade from support@flex.ai.
500 — Internal server error
Unexpected failure in our gateway or an upstream model backend.503 — Service unavailable
A specific subsystem is temporarily offline (e.g., a model under maintenance, or the playground disabled). What to do: retry later. Themessage explains which subsystem.