tiny-router

Errors

Status codes, what to retry and what not to.

Errors use the OpenAI error shape, so an existing client's handling works unchanged. A provider's own error body is forwarded verbatim; everything we generate ourselves is a fixed message with a stable code.

Status codes

FieldTypeDescription
400invalid_requestMalformed body, or a parameter the model does not support.
401unauthorizedMissing, malformed, revoked or expired key.
402insufficient_creditsThe wallet or the key's spend limit cannot cover the request.
403forbiddenThe model is disabled, or not on this key's allow-list.
404not_foundNo such model or endpoint.
429rate_limitedKey rate or concurrency limit. Honour Retry-After.
5xxupstream_errorThe provider failed. The hold is released in full.

Retrying safely

  • Retry 429 and 5xx with exponential backoff and jitter.
  • Never retry 400, 402 or 403. They will not succeed on a second attempt.
  • A failed request settles at zero. Retrying does not double-charge you for the attempt that failed.

Request ids

Every response carries an X-Request-Id. Quote it when asking about a specific call; it is the key to the whole log line, including the model actually served and the exact amount charged.