Error Codes
The API uses standard HTTP status codes and returns detailed error information in a consistent response format.
| Code | Meaning |
|---|
| 200 | Success |
| 400 | Bad Request — invalid parameters |
| 401 | Unauthorized — invalid or expired token |
| 402 | Payment Required — insufficient quota |
| 403 | Forbidden — access denied for this resource |
| 404 | Not Found — resource does not exist |
| 413 | Payload Too Large — request body too large |
| 429 | Too Many Requests — rate limit exceeded |
| 500 | Internal Server Error |
| 502 | Bad Gateway — upstream AI service unavailable |
| 503 | Service Unavailable — temporary overload |
All errors return a consistent JSON structure:
{
"error": {
"code": 400,
"message": "Invalid prompt parameter",
"type": "invalid_request_error",
"param": "prompt",
"fallback_suggestion": "provide a valid prompt"
}
}
| Field | Type | Description |
|---|
error.code | integer | HTTP status error code |
error.message | string | Human-readable error description |
error.type | string | Error type category (see below) |
error.param | string | The related parameter name (when applicable) |
error.fallback_suggestion | string | Suggested action to resolve the error |
| Type | HTTP Code | Description |
|---|
invalid_request_error | 400 | Request parameter is invalid or missing |
authentication_error | 401 | Invalid or expired API token |
insufficient_quota_error | 402 | Account has insufficient credits. Top up here |
permission_error | 403 | No permission to access this model or resource |
not_found_error | 404 | Requested resource (model, task) not found |
request_too_large_error | 413 | Request body exceeds size limits |
rate_limit_error | 429 | Too many requests — retry after the suggested interval |
internal_server_error | 500 | Internal server error — try again later |
upstream_error | 502 | Upstream AI service unavailable — try a different model |
service_unavailable_error | 503 | Service temporarily unavailable — retry after 30 seconds |
import requests
response = requests.post(
"https://api.evolink.ai/v1/videos/generations",
headers=headers,
json=payload
)
if response.status_code == 200:
task = response.json()
print(f"Task created: {task['id']}")
elif response.status_code == 429:
# Rate limited — back off and retry
print("Rate limited. Retrying...")
elif response.status_code == 402:
print("Insufficient credits. Please top up at https://evolink.ai/dashboard/billing")
else:
error = response.json().get("error", {})
print(f"Error [{error.get('type')}]: {error.get('message')}")
if error.get("fallback_suggestion"):
print(f"Suggestion: {error.get('fallback_suggestion')}")
- Failed video generations are not charged to your account
- Check the task status via Async Tasks for failure details
- Most errors can be resolved by adjusting parameters and retrying