Error Codes
Errors use the same response shape as successful requests.
{
"code": 422,
"msg": "model is not supported",
"data": null
}Common errors
| HTTP | Code | Message | Meaning |
|---|---|---|---|
400 | 400 | invalid request | The JSON body or required query parameter is invalid |
401 | 401 | authentication failed | API key is missing, invalid, or disabled |
402 | 402 | insufficient credits | The user does not have enough credits |
404 | 404 | task not found | The task does not exist or does not belong to the API key |
422 | 422 | validation error | The model or input fields are not supported |
429 | 429 | rate limit exceeded | The API key exceeded its tier limit |
500 | 500 | server error | Internal server or provider error |
Handling retries
Use X-Request-ID when creating tasks. If your backend retries a request, the same request ID can return the existing task instead of creating a duplicate task.