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.
application/octet-stream carries an opaque ehbp-v1 encrypted body and requires the Ehbp-Encapsulated-Key, Nito-Encrypted-Enclave-Url, and Nito-Encrypted-Model headers. Successful ehbp-v1 bodies stay ciphertext under their JSON or event-stream media type. Decrypt locally before parsing.
Headers
Required for application/octet-stream only: exact native model recovered from the attestation binding and used inside the encrypted body, without a gateway routing prefix or privacy suffix. Public logical aliases and auto are rejected. Missing, empty, repeated, or conflicting routing values are rejected.
Set to 1 only on non-streaming, round 0 Standard field-encryption 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.
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.
Response
Chat completion JSON or server-sent event stream.
Schema for ChatCompletion values returned by or accepted by the Nito gateway.

