Errors

Routeur returns short, JSON-shaped errors with a stable error.code and a human-readable error.message. Raw upstream provider error bodies are never relayed to callers — you'll always see a routeur-shaped envelope.

Error shape

response body
{
  "error": {
    "code":    "blocked_by_dlp",
    "message": "dlp:credit_card_redact",
    "type":    "routeur_error"
  }
}

Status & codes

400invalid_request

Malformed JSON or missing required fields such as messages.

401unauthorized

Missing or unknown routeur.ai bearer token. See Authentication.

403blocked_by_dlp

Input safety or DLP blocked the request before the upstream call. The matching rule name is in error.message.

403blocked_by_moderation

The upstream model answered but output moderation blocked the response from reaching the caller.

429rate_limited

Per-key request or token rate cap exceeded. See Rate limits.

502upstream_error

Non-timeout upstream failure or provider_unconfigured when no provider key is mounted.

504upstream_error

The upstream call hit routeur.ai's per-request timeout. Safe to retry idempotently.

Retry guidance

  • Retry: 429, 502, 504 with exponential backoff.
  • Do not retry: 400, 401, 403. The request will keep failing.