Guides
Errors, Limits, and Retries
Read error responses and rate-limit headers, retry safely, and diagnose common failures.
Every Felo API returns a JSON error body with a stable error code and a request ID. Read the HTTP status first, then the code, then the message.
Error envelope
Current production responses use the HTTP status as status:
{
"status": 401,
"code": "UNAUTHORIZED",
"message": "Invalid API Key",
"request_id": "202610221444486982113280416060637185"
}| Field | Meaning |
|---|---|
status | HTTP status code, repeated in the body |
code | Machine-readable error code |
message | Human-readable explanation |
request_id | Opaque identifier for this request; include it in support requests |
Some older endpoint examples use status: "error" and a different code string. Branch on the HTTP status and code, not on the exact wording of message.
Common codes
| HTTP | Code | What it means | What to do |
|---|---|---|---|
| 400 | Endpoint-specific validation code | A parameter is missing or invalid | Fix the request; do not retry unchanged |
| 401 | UNAUTHORIZED | Missing, invalid, expired, or revoked API key | Send Authorization: Bearer $FELO_API_KEY; rotate the key if revoked |
| 402 | INSUFFICIENT_CREDITS | Not enough service credits | Top up in Console Billing, then retry |
| 404 | Endpoint-specific | Unknown model, task, or route | Check the model ID or task ID and the endpoint path |
| 429 | RATE_LIMITED | A rate limit was exceeded | Wait for Retry-After, then retry |
| 5xx | CHAT_FAILED, *_FAILED, SERVICE_UNAVAILABLE | Upstream or service failure | Retry with backoff; contact support if it persists |
Endpoint references list the codes specific to that endpoint. Start with the Chat API errors or the reference for the endpoint you are calling.
Model generation endpoints
POST /api/v1/images/generations and POST /api/v1/videos/generations return endpoint-level errors in the OpenAI envelope instead of the envelope above:
{
"error": {
"message": "Model kind does not match this generation endpoint",
"type": "invalid_request_error",
"param": null,
"code": "model_kind_mismatch"
}
}For video generation, param names the field that caused the 400, such as input, first_frame_url, or frame_images.0.frame_type. Legacy fields, unsupported fields, and values the selected channel cannot run are rejected rather than ignored.
The request ID is in the X-Request-Id response header, not in the body. A rejected request does not create a task. Once a task exists, most failures arrive as a terminal task status in a 200 response rather than an HTTP error: check status for failed or interrupted, then read error.message. See Image Generation and Async Tasks.
Request IDs
Felo error bodies include request_id. Log it with the endpoint, HTTP status, error code, model ID, and task ID. Never log the full API key.
The Model API also accepts an optional X-Request-Id request header. When you send one, it is echoed back for diagnostics, which lets you correlate your own logs with a request. If you do not send one, use the returned request_id.
Rate limits
/v2/chat is the only Felo endpoint with documented enforced rate limits:
- Per API key, 1-minute window.
- Per user, 1-minute window.
- Per user, 1-hour window.
Users with an effective paid Felo subscription, including enterprise subscriptions, are exempt and receive no X-RateLimit-* headers. If subscription status cannot be verified, the limits still apply.
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Limit of the tightest dimension currently in effect |
X-RateLimit-Remaining | Minimum remaining quota across the three dimensions |
X-RateLimit-Reset | Unix timestamp in seconds when the current window resets |
Retry-After | On a 429, the recommended delay in seconds |
Other /v2/** endpoints currently have no enforced rate limits. Model API requests can still be limited by the upstream provider, which can surface as a 429.
Do not hardcode numeric limits. Read the headers on each response.
Retry policy
| Situation | Retry? |
|---|---|
| 400, 401, 402, 404 | No. Fix the request, the key, or the balance first. |
| 429 | Yes, after Retry-After or X-RateLimit-Reset. |
| 5xx, timeouts, connection resets | Yes, with exponential backoff and jitter. |
| Streaming connection dropped mid-response | Retry only if your application can tolerate a duplicate generation. |
Recommended loop:
- Retry only idempotent or safe-to-repeat requests.
- Use exponential backoff: start around 1 second, double it, cap at 30 seconds.
- Add random jitter so clients do not retry in lockstep.
- Stop after a small number of attempts and surface the error.
- On 429, honor
Retry-Afterinstead of your own schedule.
Debugging sequence
- Check that the key is present and not revoked.
- Call
GET /api/v1/modelswith the same key to confirm authentication. - Send the smallest valid request to the target endpoint.
- Add streaming, tools, or large inputs one at a time.
- For async work, check the task status before resubmitting.
Related
Need help?
- Contact Support for API, billing, and account questions.
- Chat with Felo developers on Discord.
- Check out our changelog.
- Need volume pricing or procurement help? Contact Sales.
- Building with an LLM? Read llms.txt.