Skip to main content
POST /v1/chat/completions accepts the OpenAI chat format. Use an OmniRelay API key and SDK base URL https://api.omnirelay.ai/v1. First query List models: public catalog entries do not grant access.

Non-streaming call

This example uses gpt-6-luna; it must appear in your own list with mode: live. See First API call for complete SDK initialization.

Parameters and capabilities

Most integrated text models allow up to 128,000 output tokens and default to 32,000 (Gemini 3.1 Pro Preview and Gemini 3.6 Flash: at most 65,536); DeepSeek V4 Pro, GLM 5.3 and Kimi K3 default to and allow at most 4,096; GPT 5.4 Mini defaults to 64 and allows at most 256. Your model-specific values take precedence. GPT routes expose documented function tools (strict/named/parallel), JSON object/schema and Responses; Astra tools require Responses. Sampling, reasoning and tool combinations are model-specific. Vision is not integrated into the billing contract. tool_choice accepts auto, none and required; selecting a specific function additionally requires capabilities.named_tool_choice. A normal JSON HTTP response is not structured JSON generation. Unsupported fields return 400 unsupported_parameter; invalid live values return 400 invalid_parameter.

GPT 5.6 Sol

gpt-5.6-sol accepts text, system/developer messages, function tools (including strict definitions, named selection and parallel calls), JSON object and strict JSON Schema output. Chat accepts reasoning_effort: none | low | medium | high | xhigh; omitted effort defaults to none. With tools or tool-result history, Chat requires none. Use Responses for reasoning with tools or max effort. temperature (0–2) and top_p (0–1) are recommended with none effort. The model provider decides incompatible combinations: it may reject them (identifiable rejections include error.param) or ignore the field and answer normally. These newly enabled combinations follow the model’s published documentation; live validation of each combination is pending. Read sampling_parameters, sampling_reasoning_efforts, chat_tools_reasoning_efforts and responses_reasoning_efforts from your own model list. null means no additional effort restriction; an empty parameter/effort list means unsupported. A minimal request needs no optional parameters:
Omitted output limits default to 32,000 tokens (DeepSeek V4 Pro, GLM 5.3 and Kimi K3: 4,096; GPT 5.4 Mini: 64); the maximum is each model’s limits.output_tokens, including reasoning tokens. Set the limit explicitly for longer reasoning tasks. JSON Schema keywords are left to the model provider.

Response and reasoning content

A successful JSON response includes choices[0].message.content, usage and cost_microusd. The charge is in micro-USD: divide by 1,000,000 for USD. If capabilities.reasoning_content is true, optional reasoning text may appear in choices[0].message.reasoning_content. This is distinct from accepting reasoning_effort: displaying reasoning does not imply it can be switched off or adjusted. Currently DeepSeek V4 Pro and GLM 5.3 can return this field. Omitted reasoning detail counters do not remove completion tokens from billing. Save the X-Request-ID response header; support uses it to look up a call. Optional Request metadata provides additional routing information.

Streaming

Check capabilities.stream before enabling SSE. Successful streams end with data: [DONE]; the final choice chunk carries a finish reason such as stop or length. A usage chunk has no choices, so handle it separately.
Python
For supported models, streaming reasoning text is choices[0].delta.reasoning_content. The gateway always collects final usage, even when the client does not request the usage chunk.
Disable automatic SDK retries. A timeout, error event or missing [DONE] can leave a live charge pending reconciliation. Use the error code to decide whether the call was charged before sending another paid call. An HTTP 200 at stream opening alone does not establish success. See Usage and billing and Errors.
See the Create chat completion for the full schema.

Capability matching across callable models

Every callable route, including sale aliases, has an explicit contract. Choose parameters from your own /v1/models response. Documented features are forwarded; budget and protocol checks remain necessary. New parameter combinations are documentation-based and await individual live validation. Preserve assistant reasoning_content when replaying DeepSeek tool conversations. Read tool_choice_values, tool_choice_reasoning_efforts, thinking_modes and parameter_ranges; Claude/GLM temperature is at most 1 and GLM top_p at least 0.01. Ordinary optional null values are forwarded and the model provider decides; empty tool lists are accepted. Multiple candidates, extra paid services, hosted tools and image/audio inputs require their own settlement contracts.

Parameter passthrough

All callable models use parameter_policy: upstream-first. Capability flags are documented guidance. Ordinary fields are not rejected because a local flag is false, an effort is absent from a list or a schema keyword is new. The model provider decides on fields and combinations and may ignore unsupported ones. Function definitions, legacy functions, reasoning history, ordinary extension fields and schemas are preserved. Sampling is not silently removed; the gateway does not change requested effort or protocol. Some models ignore fields they do not support instead of rejecting them, so a successful response does not prove that an optional field took effect; rely on the capability list for what is supported. Model access, authentication, body size, output budgets and fee reservation still apply. Multiple candidates, paid service tiers, pro reasoning, hosted tools, media, stored state and background requests need separate settlement contracts. Output-limit aliases are normalized, with a default when omitted; default effort is supplied only without explicit effort/reasoning/thinking. JSON/stream extension fields are retained; OmniRelay supplies settled cost. Model provider 400/422 rejections release holds and are not charged; provider failures (5xx), timeouts and interrupted streams remain pending reconciliation. New combinations await individual paid validation.