Overview›Responses & Errors

Responses & Errors

routing.run returns standard HTTP status codes and a consistent JSON envelope for non-streaming errors. The numeric code matches the HTTP status; the uppercase type is the stable machine-readable category.

Common status codes

  • 200 — Success. The response body contains the result.
  • 400 — Bad request. Check your request body and parameters.
  • 401 — Invalid or missing API key.
  • 404 — Unknown model ID or endpoint.
  • 429 — A traffic or upstream capacity limit was reached.
  • 502 — Upstream provider unavailable. Retry with exponential backoff.

Error response format

Non-streaming HTTP errors return a JSON body with this shape:

json
{  "error": {    "message": "Human-readable error description",    "code": 400,    "type": "BAD_REQUEST",    "details": {}  }}

Rate limiting

The API returns 429 when an account, API key, concurrency, or upstream capacity limit is reached. Implement exponential backoff with jitter in your client.

Check the Retry-After header for the recommended wait time before retrying.