Skip to main content
POST

Authorizations

Authorization
string
header
required

An API key created in the OmniRelay console. The owner can view it again in the console after confirming their identity.

Headers

X-Gateway-Tags
string

Tags for this call as comma-separated key=value pairs, for example client=acme,env=prod. Merged with the API key's default tags; the tags body field wins on the same key. X-OmniRelay-Tags is the same header under its former name and stays accepted.

X-Gateway-Metadata
enum<string>

Send enabled to receive a gateway_metadata block describing what the gateway decided. Any other value, or no header, leaves the response unchanged. X-OmniRelay-Metadata is the same header under its former name and stays accepted.

Available options:
enabled

Body

application/json

Parameter passthrough: ordinary extension fields are forwarded; authentication, text/function protocol and budget settlement boundaries remain enforced.

model
string
required

An active model ID from GET /v1/models.

Example:

"gpt-6-luna"

messages
object[]
required

1 to 2000 text messages within the model context contract. Request body limit: 4 MiB (4194304 bytes of UTF-8). Provider-context-ceiling reserves input/output separately; the provider validates actual context fit.

Required array length: 1 - 2000 elements
stream
boolean
default:false

Deliver the answer as server-sent events instead of one JSON body.

stream_options
object

Only read when stream is true.

tags
object

Tags for this call. At most 10 after merging with the header and the key's default tags. Keys are 1 to 64 characters and stored in lowercase; values are 1 to 128 characters. Both use only letters, digits and - _ . : /. Keys starting with gateway: or omnirelay: are reserved. A tags field that is not an object is ignored.

Example:
max_tokens
integer

Live only. Positive integer; send one output-limit field, never both. The gateway normalizes it for the model. Read limits.output_tokens and limits.default_output_tokens from your model list; GPT 5.4 Mini uses 64/256; most other integrated text routes default to 32,000 up to 128,000 (Gemini 3.1 Pro Preview and Gemini 3.6 Flash: 65,536); DeepSeek V4 Pro, GLM 5.3 and Kimi K3 use 4,096/4,096.

Required range: x >= 1
max_completion_tokens
integer

Live only. Positive integer; send one output-limit field, never both. The gateway normalizes it for the model. Read limits.output_tokens and limits.default_output_tokens from your model list; GPT 5.4 Mini uses 64/256; most other integrated text routes default to 32,000 up to 128,000 (Gemini 3.1 Pro Preview and Gemini 3.6 Flash: 65,536); DeepSeek V4 Pro, GLM 5.3 and Kimi K3 use 4,096/4,096.

Required range: x >= 1
temperature
number

Forwarded; the model provider decides and may ignore unsupported values. Consult model-specific documented guidance.

Required range: 0 <= x <= 2
top_p
number

Forwarded; the model provider decides and may ignore unsupported values. Consult model-specific documented guidance.

Required range: 0 <= x <= 1
frequency_penalty
number

Live only and only when supported by the reviewed endpoint.

Required range: -2 <= x <= 2
presence_penalty
number

Live only and only when supported by the reviewed endpoint.

Required range: -2 <= x <= 2
seed
integer

Live only and only when supported by the reviewed endpoint.

stop

Live only and only when supported by the reviewed endpoint.

Maximum string length: 256
n
enum<integer>

Live only. Multiple completions per request are not supported.

Available options:
1
tools
object[]

Live only when tools are supported. Function tools only; strict tools and JSON Schema keywords require separate support. See the provider integration guide.

Required array length: 1 - 64 elements
tool_choice

Use auto, none or required when tool_choice is advertised. Named function selection additionally requires capabilities.named_tool_choice.

Available options:
auto,
none,
required
parallel_tool_calls
boolean

Live only and only when supported by the reviewed endpoint.

response_format
object

Forwarded; the model provider decides and may ignore unsupported values. Consult model-specific documented guidance.

reasoning_effort
string

Forwarded; the model provider decides and may ignore unsupported values. Consult model-specific documented guidance.

thinking
object

Only for models advertising thinking_modes; GLM 5.3 only accepts enabled.

tool_stream
boolean

For models advertising tool_stream; true requires stream:true.

Response

Completion with settled usage and cost, or an SSE stream. A failed stream may emit an error after HTTP 200 and ends without [DONE].

id
string
required
Example:

"chatcmpl-2f6c1d0e9a"

object
enum<string>
required
Available options:
chat.completion
created
integer
required

Unix timestamp in seconds.

model
string
required
choices
object[]
required
usage
object
required

Validated provider usage; missing or invalid usage prevents automatic settlement. Prompt usage includes cache partitions; completion includes reasoning. Omitted detail counters do not erase token usage.

cost_microusd
integer
required

Settled customer charge in micro-USD, using frozen prices, token partitions, tiers and discount. Round the full sum, apply the discount and round up again. This is the final charge, not the maximum hold.

omnirelay_metadata
object

Present only when the request sent X-Gateway-Metadata: enabled. Returned under both gateway_metadata and its former name omnirelay_metadata, with the same content. On a stream it rides the first chunk.

gateway_metadata
object

Present only when the request sent X-Gateway-Metadata: enabled. Returned under both gateway_metadata and its former name omnirelay_metadata, with the same content. On a stream it rides the first chunk.