Errors

Every /v1/* gateway error, chat completions, embeddings, threads, uses the same envelope:

{
  "error": {
    "message": "Model gpt-4 is not served on this gateway",
    "type": "invalid_request_error",
    "code": "model_not_allowed"
  }
}

type is "invalid_request_error" for anything the caller can fix by changing the request, and "server_error" for upstream failures.

Codes

CodeStatusWhen
missing_key401No Authorization header
bad_key401Key is unknown, revoked, or its project is inactive
model_not_allowed400Model isn’t served by this gateway at all
model_not_allowed403Model is served, but this key’s allowed_models doesn’t include it
empty_messages400messages is an empty array
empty_input400/v1/embeddings input resolves to an empty list
thread_messages_invalid400With thread_id, messages wasn’t exactly one user message plus any system messages
thread_multimodal_not_supported400Image content sent alongside a thread_id
context_length_exceeded400Prompt (or system block, or a single embeddings input) exceeds the model’s context window
thread_not_found404Thread doesn’t exist, or belongs to another project
nothing_to_continue409The thread’s last assistant turn already finished normally
rate_limit_exceeded429This key’s requests-per-minute bucket is full
budget_exceeded429This project is at or over its monthly token budget
upstream_error502 (or the upstream’s own status, e.g. 503 with no reachable upstream)Ollama or OpenRouter failed or was unreachable

See Usage, rate limits & budgets for exactly what the two 429s mean in practice, and Local vs. cloud routing for why a model id might land in the 400 vs. the 403 case above.

The admin/console surface

/keys and /projects (minting and revoking API keys, managing projects) are a separate, console-only, cookie-authenticated surface. They return plain FastAPI {"detail": "..."} errors, not the envelope above, see Authentication & API keys.