Error Codes
This document describes the error codes returned in API responses.
Response Format
When a task fails, the response includes error information:
{
"id": "prediction-uuid",
"status": "failed",
"code": 1401,
"error": "Error description",
...
}| Field | Description |
|---|---|
code | Error code. 0 indicates success. |
error | Error message. Empty on success. |
Success
| Code | Description |
|---|---|
| 0 | Success |
Client Errors (1xxx)
| Code | Name | Description | Suggested Action |
|---|---|---|---|
| 1200 | Content Moderation | The content contains sensitive information. | Modify the input content and retry. |
| 1400 | Missing Parameter | A required parameter is missing. | Check the API documentation for required parameters. |
| 1401 | Invalid Parameter | The parameter value is invalid. | Verify parameter format and value constraints. |
| 1402 | Media Access Failed | Unable to access the provided media URL. | Ensure the URL is publicly accessible and valid. |
| 1403 | Task Execution Failed | The task could not be completed. | Check the error message and adjust input parameters. |
| 1405 | Unknown Error | The failure did not match a more specific public error category. | Check the error message, verify the input, and retry only when appropriate. |
| 1406 | Retry Exhausted | The service could not complete the task after exhausting its retry attempts. | Retry later with bounded exponential backoff; contact support if the failure persists. |
| 1407 | insufficient_credits | The account does not have enough credits to run the request. | Top up your account and retry. |
Server Errors (5xxx)
| Code | Name | Description | Suggested Action |
|---|---|---|---|
| 5000 | Internal Error | An internal error occurred. | Please try again later. |
| 5003 | Service Unavailable | The service is temporarily unavailable. | Please try again later. |
| 5004 | Timeout | The request timed out. In sync mode, the prediction may still be processing and the response body can include its id. | Poll GET /api/v3/predictions/{id}/result; otherwise reduce input size or complexity and retry. |
Pricing Request Errors
Price queries and inference submissions can fail before a task is created.
These errors use an API response envelope with code and message, rather than
the task result format above. The HTTP status is 400; the application code is:
| Code | Name | Description |
|---|---|---|
| 4005 | Pricing Failed | The model price could not be calculated. Check pricing inputs; contact support if valid inputs still fail. |
| 4006 | Media Duration Unavailable | The duration of the provided media could not be measured. Check media accessibility and format. |
| 4007 | Image Dimensions Unavailable | The dimensions of the provided JPEG or PNG image could not be read. Check image accessibility and validity. |
See Pricing API for an error response example and base-price preview handling.
Best Practices
- 1xxx errors: Review and correct your request parameters.
- 5xxx errors: Retry with exponential backoff.
Example
{
"id": "abc123",
"model": "model-name",
"status": "failed",
"code": 1402,
"error": "Failed to download image from the provided URL.",
"outputs": []
}