Chat completion
POST/v1/chat/completions
OpenAI-compatible chat completions. Accepts any model the gateway
has a provider for — gpt-*, claude-*, gemini-*, ollama/*,
mock/*, and so on. Set stream: true to receive SSE deltas.
The gateway runs the full pre-dispatch pipeline (template resolution,
budget enforcement, policy evaluation, PII scan, guardrails, priority
admission, model downgrade, context window check) before any upstream
call. A non-streaming response completes the post-dispatch pipeline
before delivery. A stream relays events immediately when its configured
controls are observational, or holds the complete response when a
control can block or transform output. Set
stream_options.include_usage: true to receive usage in the final
chunk. DVARA also records exact terminal provider usage when available
and estimates it otherwise.
Request
Responses
- 200
- 400
- 402
- 403
- 429
- 502
Chat completion
Request was rejected before dispatch — missing credentials, unknown model, invalid response_format, or capability mismatch.
The workspace's hard budget cap is exhausted (BUDGET_CAP_HARD).
Request was blocked by an active policy rule (POLICY_DENIED, PII_DETECTED, GUARDRAIL_BLOCKED, IP_ACCESS_DENIED).
Per-key rate limit reached, or priority admission control throttled the request (PRIORITY_THROTTLED).
Every configured provider on the route (and every fallback) has failed.