Errors and limits
Every error comes with the HTTP status, a stable code your code can branch on, and a message saying what to do.
Format
Media responses come wrapped in an envelope with code, message and data. On an error, code repeats the HTTP status, message explains why, and error_code tells you which error it was.
{
"code": 402,
"message": "Saldo insuficiente. Esta geração custa $1.70.",
"data": null,
"error_code": "insufficient_balance"
}Branch on error_code, never on the text of message: the message is meant for people and may change (today it's written in Portuguese), while codes never get renamed. LLM endpoints follow the OpenAI error format, so the same code comes in error.code.
{
"error": {
"message": "O modelo está sobrecarregado. Tente novamente em instantes.",
"type": "rate_limit_error",
"code": "model_overloaded"
}
}Codes
| error_code | HTTP | When it happens and what to do |
|---|---|---|
invalid_request | 400 | A parameter is invalid or a required one is missing. Fix the body based on the message. |
price_limit_exceeded | 400 | The price exceeds the per-generation (or per-LLM-call) limit set for the account. New accounts have no such limit: the prepaid balance is already the cap. |
currency_mismatch | 400 | The account is billed in a currency the model has no price in. |
model_refused | 400 | The model refused the request (content or parameters). Nothing was charged. |
unauthenticated | 401 | The key is missing, wrong or revoked. Check the Authorization header. |
insufficient_balance | 402 | Your balance doesn't cover the price of the request. Top up and resend. |
key_monthly_limit | 402 | The key hit the monthly limit set on the account. Raise the limit or use another key. |
account_suspended | 403 | The account is suspended. Contact support. |
model_not_found | 404 | The model doesn't exist. Check the ID in the model reference. |
not_found | 404 | The request (or other resource) doesn't exist on this account. |
route_not_found | 404 | The endpoint doesn't exist. Check the path and the method. |
idempotency_conflict | 409 | The Idempotency-Key was already used with a different body. Use a new value for a different request. |
payload_too_large | 413 | The body is over 1 MB. Send files by URL. |
concurrency_limit | 429 | You hit the limit of concurrent generations. Wait for one to finish and resend. |
model_overloaded | 429 | The model is overloaded. Try again shortly. |
rate_limited | 429 | Too many calls in a short time. Wait a minute. |
provider_error | 502 | The model failed to respond. Nothing was charged; try again. |
pricing_unavailable | 503 | The price couldn't be calculated right now. Try again in a few seconds. |
service_unavailable | 503 | The service is temporarily unavailable. Try again shortly. |
internal_error | 500 | Our error. Try again; if it keeps happening, contact support. |
None of the errors above charge anything. An accepted request that fails later shows up with status failed when you poll it, with the reason in error, and isn't charged either. New codes may be added; handle an unknown code by its HTTP status.
Account limits
| Limit | Default | What happens |
|---|---|---|
Balance | Whatever you've topped up | Accounts are prepaid: a request your balance doesn't cover is rejected with 402 (insufficient_balance) and nothing is charged. |
Key monthly limit | Your choice | Optional, per key, under API keys. Once reached, the key stops generating until the month rolls over (402, key_monthly_limit). The Claude and ChatGPT connector starts at $50 a month, which you can change when you authorize it or later. |
Concurrent generations | 20 | The next one is rejected with 429 (concurrency_limit) until one finishes. |
Price per generation | No cap | Any model can run, as long as your balance covers it. |
Need more? Email hello@wizzyflow.ai and tell us about your usage.