Error Codes

The API uses standard HTTP status codes and returns detailed error information in a consistent response format.

HTTP Status Codes

CodeMeaning
200Success
400Bad Request — invalid parameters
401Unauthorized — invalid or expired token
402Payment Required — insufficient quota
403Forbidden — access denied for this resource
404Not Found — resource does not exist
413Payload Too Large — request body too large
429Too Many Requests — rate limit exceeded
500Internal Server Error
502Bad Gateway — upstream AI service unavailable
503Service Unavailable — temporary overload

Error Response Format

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"
    }
}

Error Response Fields

FieldTypeDescription
error.codeintegerHTTP status error code
error.messagestringHuman-readable error description
error.typestringError type category (see below)
error.paramstringThe related parameter name (when applicable)
error.fallback_suggestionstringSuggested action to resolve the error

Error Types

TypeHTTP CodeDescription
invalid_request_error400Request parameter is invalid or missing
authentication_error401Invalid or expired API token
insufficient_quota_error402Account has insufficient credits. Top up here
permission_error403No permission to access this model or resource
not_found_error404Requested resource (model, task) not found
request_too_large_error413Request body exceeds size limits
rate_limit_error429Too many requests — retry after the suggested interval
internal_server_error500Internal server error — try again later
upstream_error502Upstream AI service unavailable — try a different model
service_unavailable_error503Service temporarily unavailable — retry after 30 seconds

Handling Errors

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 Generations

  • 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