Gateway API

Errors

Every error is an OpenAI-shaped error object, so existing error-handling code that checks error.type or error.code keeps working unmodified.

Error shape

{
  "error": {
    "message": "Human-readable description of what went wrong.",
    "type": "invalid_request_error",
    "code": "model_not_allowed"
  }
}

The response also carries an x-tempr-request-id header — include it when contacting support about a specific failed request.

Common errors

StatusCodeMeaning
401invalid_api_keyThe virtual key is missing, malformed, or revoked.
403model_not_allowedThe requested model isn't on this key's allowlist.
429rate_limitedKey-level or plan-level RPM/TPM ceiling exceeded. Check the x-tempr-quota header and back off.
402 / 429quota_exceededMonthly request quota reached (Free hard block, or a paid plan's overage cap hit). Upgrade or wait for the next billing cycle.
402budget_exceededThe virtual key's configured spend budget has been reached.
4xx/5xxupstream_errorThe provider itself returned an error; Tempr passes the upstream status through where possible.
500stream_truncatedAn in-progress streaming response was cut off before completion. Safe to retry.

Retries & fallback

Tempr already retries transient upstream 429/5xx errors against the same provider before giving up, and — if you've configured a fallback chain on the key — falls back to the next candidate model automatically. A client-visible error means Tempr's own retry and fallback logic was exhausted, so treat it as a real failure rather than immediately retrying in a tight loop.