Create a chat completion
Create an OpenAI Chat Completions-compatible response through the /v1 facade.
This route shares validation, routing, billing, privacy, and streaming behavior with the gateway-native chat route while preserving OpenAI-compatible request and response envelopes for SDK clients. Streaming responses emit text/event-stream chunks with data: framing and [DONE] termination.
Authorizations
Org API key as Authorization: Bearer z_sk_...
Headers
Enable Encrypted message transport.
Client ephemeral public key as 64 hexadecimal characters.
Attested model public key as 64 hexadecimal characters.
Attestation signing algorithm: ed25519 or ecdsa.
Encrypted transport version. Required as 2 for NEAR and Phala strict v2; omit for the legacy Phala protocol selected by a redpill-attestation-report-v1 or provider-supplied redpill-report attestation marker.
Fresh request-bound attestation nonce required for Phala strict v2. Omit for legacy Phala and NEAR.
Positive Unix timestamp required for Phala strict v2. Omit for legacy Phala and NEAR.
Set to 1 for NEAR encrypted-all-fields mode. Message content, function names/descriptions/arguments, and tool results are ciphertext hex; function parameters is a JSON string containing ciphertext hex.
Short-lived opaque Free-tier reservation UUID returned by a prior browser helper or chat bootstrap operation.
Monotonic reservation-consumption round for the paired reservation UUID. Rounds span completion and browser helper operations.
Set to 1 only on non-streaming, round 0 NEAR Encrypted browser chat bootstrap requests that also set nito-encrypted-encrypt-all-fields: 1. This header is incompatible with stream: true, nito-free-tier-reservation, and nito-free-tier-reservation-round.
Required when nito-free-tier-reservation-create: 1 is set. Supply a request-local non-nil UUID for the non-streaming, round 0 NEAR Encrypted browser chat bootstrap so a lost response can recover the same reservation.
Request-local non-nil UUID correlating the selected-model turn with helper operations. This value never selects routing, pricing, allowance, or settlement behavior.
Bounded integer from 0 through 32 identifying the encrypted tool-loop sequence for correlation only. This value never selects settlement behavior.
Set to 1 to include request-local original request/response bytes and provider signature evidence. Requires Encrypted, stream: false, and a provider that supports response evidence. Returned evidence is unverified. See response_evidence in ChatCompletion.
Body
Request payload for createOpenAIChatCompletion. Examples use placeholder-safe values and do not include real secrets or private prompt content.
- Option 1
- Option 2
OpenAI-compatible chat request. Unknown fields are ignored after duplicate-key checks; recognized fields that request unsupported behavior are rejected.
The messages field on OpenAIChatCompletionRequest.
1Nested schema within OpenAIChatCompletionRequest for OpenAIChatCompletionRequest.messages.items.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
The audio field on OpenAIChatCompletionRequest.
null
The cache_control field on OpenAIChatCompletionRequest.
The completionOptions field on OpenAIChatCompletionRequest.
The frequency_penalty field on OpenAIChatCompletionRequest.
-2 <= x <= 20.5
Deprecated function-call control. Only none is accepted; surrounding whitespace is normalized.
^\s*none\s*$"none"
The functions field on OpenAIChatCompletionRequest.
0 elementThe logit_bias field on OpenAIChatCompletionRequest.
The logprobs field on OpenAIChatCompletionRequest.
false
The max_completion_tokens field on OpenAIChatCompletionRequest.
12
The max_tokens field on OpenAIChatCompletionRequest.
12
The metadata field on OpenAIChatCompletionRequest.
The modalities field on OpenAIChatCompletionRequest.
1 elementNested schema within OpenAIChatCompletionRequest for OpenAIChatCompletionRequest.modalities.oneOf[0].items.
^\s*([Tt][Ee][Xx][Tt])\s*$The model field on OpenAIChatCompletionRequest.
"openai/gpt-5.5"
The n field on OpenAIChatCompletionRequest.
1
The parallel_tool_calls field on OpenAIChatCompletionRequest.
true
The prediction field on OpenAIChatCompletionRequest.
null
The presence_penalty field on OpenAIChatCompletionRequest.
-2 <= x <= 20.5
Prompt cache key limited to 256 UTF-8 bytes at runtime.
256"Say hello."
The prompt_cache_options field on OpenAIChatCompletionRequest.
null
The prompt_cache_retention field on OpenAIChatCompletionRequest.
null
The reasoning field on OpenAIChatCompletionRequest.
The reasoning_effort field on OpenAIChatCompletionRequest.
minimal, low, medium, high "minimal"
The response_format field on OpenAIChatCompletionRequest.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
The safety_identifier field on OpenAIChatCompletionRequest.
"example"
The seed field on OpenAIChatCompletionRequest.
null
The service_tier field on OpenAIChatCompletionRequest.
^\s*(auto|default)?\s*$"example"
The stop field on OpenAIChatCompletionRequest.
1"example"
The store field on OpenAIChatCompletionRequest.
false
The stream field on OpenAIChatCompletionRequest.
true
The stream_options field on OpenAIChatCompletionRequest.
The temperature field on OpenAIChatCompletionRequest.
0.5
The tool_choice field on OpenAIChatCompletionRequest.
auto, none, required "auto"
The tools field on OpenAIChatCompletionRequest.
Nested schema within OpenAIChatCompletionRequest for OpenAIChatCompletionRequest.tools.items.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
The top_logprobs field on OpenAIChatCompletionRequest.
0
The top_p field on OpenAIChatCompletionRequest.
0.5
The user field on OpenAIChatCompletionRequest.
"example"
The verbosity field on OpenAIChatCompletionRequest.
^\s*([Ll][Oo][Ww]|[Mm][Ee][Dd][Ii][Uu][Mm]|[Hh][Ii][Gg][Hh])?\s*$"example"
The web_fetch field on OpenAIChatCompletionRequest.
true
The web_search field on OpenAIChatCompletionRequest.
true
The web_search_options field on OpenAIChatCompletionRequest.
null
Response
Chat completion JSON or server-sent event stream.
Schema for ChatCompletion values returned by or accepted by the Nito gateway.
The choices field on ChatCompletion.
The created field on ChatCompletion.
1778268600
The id field on ChatCompletion.
"00000000-0000-4000-8000-000000000001"
The model field on ChatCompletion.
"openai/gpt-5.5"
The object field on ChatCompletion.
"example"
The usage field on ChatCompletion.
Deployment-scoped, non-reversible account comparison label; not a raw identifier.
^nref_[0-9a-f]{24}$"nref_0123456789abcdef01234567"
Deployment-scoped, non-reversible credential comparison label; not a raw identifier.
^nref_[0-9a-f]{24}$"nref_0123456789abcdef01234567"
The free_tier field on ChatCompletion.
"example"
The free_tier_reservation field on ChatCompletion.
"example"
The nito_operation_id field on ChatCompletion.
"00000000-0000-4000-8000-000000000001"
Deployment-scoped, non-reversible organization comparison label; not a raw identifier.
^nref_[0-9a-f]{24}$"nref_0123456789abcdef01234567"
The system_fingerprint field on ChatCompletion.
"example"
The web_search field on ChatCompletion.
Optional original exchange and signature evidence for client verification. Returned only when requested on a supported nonstreaming Encrypted call.

