Skip to main content
Chat completions are the core of Omnia. The endpoint is fully OpenAI-compatible, so any OpenAI SDK or HTTP client works by pointing base_url at https://gateway.omnia-voice.com/v1 and using your Omnia API key. Request and response shapes are the standard OpenAI shapes: id, object, choices, and a usage object with prompt_tokens, completion_tokens, and total_tokens.

Basic request

Model ids are namespaced, like Qwen/Qwen3-32B. Discover what’s available with GET /v1/models and pass any returned id as model.

The response

string
Unique id for this completion.
array
One entry per generated choice. Each has an index, a message (role + content, plus tool_calls when tools are used), and a finish_reason (stop, length, tool_calls, …).
object
prompt_tokens, completion_tokens, and total_tokens. This reflects the exact tokens billed to your wallet.

Parameters

Omnia forwards a fixed allow-list of parameters to the model. model is required, and everything else is optional.
Unknown parameters are silently ignored, not rejected. The gateway forwards only the fields in the table above; anything else (vendor extensions, non-standard flags, store, and so on) is stripped from the request before it reaches the model. This is a deliberate security allow-list. Your request will not error; the unrecognized field simply has no effect.
max_tokens is capped at the model’s context window. Requesting more than the model supports is rejected before any tokens are generated, so you never pay for an impossible request.

Fallback models

Pass fallbacks, a list of up to 2 backup model ids, and the gateway runs a retry-then-fallback ladder for you: the primary model is retried once on a transient failure, then each fallback is tried in order. You only ever get a 502 after every model in the chain has failed.
How the ladder behaves:
  • Only transient failures descend the ladder: rate limits (429), timeouts, and upstream 5xx/connection failures. Deterministic client errors (a bad parameter, a prompt over the context window) fail identically on every model, so they return immediately without burning attempts.
  • You’re always told who answered. The response’s model field names the model that actually served, and when a fallback kicked in the response carries an X-Omnia-Fallback-From header naming the model it fell back from. The request detail in Observability shows the same.
  • You pay for what ran. Billing uses the model that actually answered, at that model’s own price. (The pre-flight balance check covers the priciest model in your chain, so a fallback can never overdraft your wallet.)
  • Streaming falls back only before the first token. Once output has started streaming, the gateway never switches models mid-response.
  • Every fallback id must be a valid, available model: an unknown id is rejected up front with a 400, never discovered mid-request.
fallbacks is supported on chat completions only, and not on dedicated endpoints (a dedicated endpoint is a specific deployment; there is nothing to fall back to).

Response caching

If your workspace has response caching enabled (it’s opt-in, off by default), a byte-identical chat request repeated within your retention window is served straight from the gateway’s cache: no model run, billed at 25% of the normal price. No request changes are needed; every cache-eligible response tells you what happened via a header:
Individual requests can opt out without touching the workspace setting: send X-Omnia-Cache-Control: no-cache to force a fresh model run (the cached copy is refreshed), or no-store to also keep the response out of cache storage entirely; see per-request control. Works for streaming and non-streaming alike (one cache entry serves both modes; stream doesn’t change the cache key), including tool-call responses. Requests with n > 1 bypass the cache, and errors or dropped streams are never stored. How caching and fallbacks interact:
  • The fallbacks list is part of the cache key: the same messages with a different (or no) fallback chain are separate entries.
  • Only primary-served responses are stored. A response that came from a fallback model is never cached, so a cache hit always replays, and bills, the model you asked for.
See Response caching for what enabling it stores, the retention windows, and when it pays off.

Reasoning models

Reasoning models accept reasoning_effort to trade latency and cost against answer quality. Higher effort spends more time (and completion tokens) reasoning before answering.

Multiple choices and log probabilities

Set n to return several independent completions in one call, and enable logprobs (optionally with top_logprobs) to inspect the model’s token-level confidence.

Multi-turn conversations

Omnia is stateless: it stores nothing between calls. To continue a conversation, resend the full message history: append the assistant’s previous reply and the new user message, then call the endpoint again.

Errors and rate limits

Rate limits are enforced per model as tokens-per-minute (TPM) and requests-per-minute (RPM). Exceeding them returns HTTP 429; see Rate limits. For the full list of error codes and how to handle them, see Errors.