Skip to content

Errors

API errors return JSON with a consistent error object.

json
{
  "error": {
    "message": "Invalid request body",
    "type": "invalid_request_error",
    "code": "Bad Request"
  }
}

Some errors also include an error_id for support and log correlation.

Use the Error Resolver when you need to classify a raw status/body pair. Admins can use Error Templates in the rout.my admin panel to map recurring upstream provider messages into safe user-facing messages.

Status codes

StatusMeaningCommon fix
400Invalid request body, missing field, unsupported parameter, or policy-blocked prompt.Validate JSON and required fields.
401Missing or invalid API key.Check the Authorization header or compatible auth field.
403The key is valid, but the model is not available to the account.Use an available model ID or update plan/access.
404Wrong path or unknown model.Check endpoint URL and copy the model ID from /v1/models.
405Method not allowed.Use the documented HTTP method.
429Rate limit or quota exhausted.Wait, reduce request size, or check quota.
499Client disconnected before the server finished.Keep the connection open; use longer client timeouts for long video requests.
500Internal server error.Retry later or contact support with request details.
502Upstream provider failed or no provider succeeded.Retry or use another available model.
503Temporary service or quota backend issue.Retry with backoff.

Retry behavior

Retry transient statuses with exponential backoff:

Retry?Status
Yes429, 500, 502, 503
No400, 401, 403, 404, 405

Use jitter so many clients do not retry at the same moment.

python
import random
import time

def sleep_before_retry(attempt):
    delay = min(30, (2 ** attempt) + random.random())
    time.sleep(delay)

Long-running requests

Video generation can run for several minutes. Configure clients and reverse proxies with long enough timeouts. With curl, use:

bash
curl --max-time 900 ...

API documentation for rout.my.