Skip to main content
POST
Create an OpenAI-compatible chat completion

Authorizations

Authorization
string
header
required

Org API key as Authorization: Bearer z_sk_...

Headers

nito-encrypted
string

Enable Encrypted message transport.

nito-encrypted-client-pub-key
string

Client ephemeral public key as 64 hexadecimal characters.

nito-encrypted-model-pub-key
string

Attested model public key as 64 hexadecimal characters.

nito-encrypted-signing-algo
string

Attestation signing algorithm: ed25519 or ecdsa.

nito-encrypted-encryption-version
string

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.

nito-encrypted-nonce
string

Fresh request-bound attestation nonce required for Phala strict v2. Omit for legacy Phala and NEAR.

nito-encrypted-timestamp
string

Positive Unix timestamp required for Phala strict v2. Omit for legacy Phala and NEAR.

nito-encrypted-encrypt-all-fields
string

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.

nito-free-tier-reservation
string

Short-lived opaque Free-tier reservation UUID returned by a prior browser helper or chat bootstrap operation.

nito-free-tier-reservation-round
string

Monotonic reservation-consumption round for the paired reservation UUID. Rounds span completion and browser helper operations.

nito-free-tier-reservation-create
string

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.

nito-free-tier-bootstrap
string

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.

nito-parent-request-id
string<uuid>

Request-local non-nil UUID correlating the selected-model turn with helper operations. This value never selects routing, pricing, allowance, or settlement behavior.

nito-tool-call-round
string

Bounded integer from 0 through 32 identifying the encrypted tool-loop sequence for correlation only. This value never selects settlement behavior.

nito-encrypted-response-evidence
string

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.

OpenAI-compatible chat request. Unknown fields are ignored after duplicate-key checks; recognized fields that request unsupported behavior are rejected.

messages
object[]
required

The messages field on OpenAIChatCompletionRequest.

Minimum array length: 1

Nested schema within OpenAIChatCompletionRequest for OpenAIChatCompletionRequest.messages.items.

Example:
audio
null

The audio field on OpenAIChatCompletionRequest.

Example:

null

cache_control
object

The cache_control field on OpenAIChatCompletionRequest.

Example:
completionOptions
object

The completionOptions field on OpenAIChatCompletionRequest.

Example:
frequency_penalty
number | null

The frequency_penalty field on OpenAIChatCompletionRequest.

Required range: -2 <= x <= 2
Example:

0.5

function_call
string | null

Deprecated function-call control. Only none is accepted; surrounding whitespace is normalized.

Pattern: ^\s*none\s*$
Example:

"none"

functions
object[] | null

The functions field on OpenAIChatCompletionRequest.

Required array length: 0 element
Example:
logit_bias
object | null

The logit_bias field on OpenAIChatCompletionRequest.

Example:
logprobs
boolean | null

The logprobs field on OpenAIChatCompletionRequest.

Example:

false

max_completion_tokens
integer

The max_completion_tokens field on OpenAIChatCompletionRequest.

Example:

12

max_tokens
integer

The max_tokens field on OpenAIChatCompletionRequest.

Example:

12

metadata
object | null

The metadata field on OpenAIChatCompletionRequest.

Example:
modalities
string[] | null

The modalities field on OpenAIChatCompletionRequest.

Required array length: 1 element

Nested schema within OpenAIChatCompletionRequest for OpenAIChatCompletionRequest.modalities.oneOf[0].items.

Pattern: ^\s*([Tt][Ee][Xx][Tt])\s*$
Example:
model
string

The model field on OpenAIChatCompletionRequest.

Example:

"openai/gpt-5.5"

n
integer | null

The n field on OpenAIChatCompletionRequest.

Example:

1

parallel_tool_calls
boolean | null

The parallel_tool_calls field on OpenAIChatCompletionRequest.

Example:

true

prediction
null

The prediction field on OpenAIChatCompletionRequest.

Example:

null

presence_penalty
number | null

The presence_penalty field on OpenAIChatCompletionRequest.

Required range: -2 <= x <= 2
Example:

0.5

prompt_cache_key
string

Prompt cache key limited to 256 UTF-8 bytes at runtime.

Maximum string length: 256
Example:

"Say hello."

prompt_cache_options
null

The prompt_cache_options field on OpenAIChatCompletionRequest.

Example:

null

prompt_cache_retention
null

The prompt_cache_retention field on OpenAIChatCompletionRequest.

Example:

null

reasoning
object

The reasoning field on OpenAIChatCompletionRequest.

Example:
reasoning_effort
enum<string>

The reasoning_effort field on OpenAIChatCompletionRequest.

Available options:
minimal,
low,
medium,
high
Example:

"minimal"

response_format
object

The response_format field on OpenAIChatCompletionRequest.

Example:
safety_identifier
string | null

The safety_identifier field on OpenAIChatCompletionRequest.

Example:

"example"

seed
null

The seed field on OpenAIChatCompletionRequest.

Example:

null

service_tier
string | null

The service_tier field on OpenAIChatCompletionRequest.

Pattern: ^\s*(auto|default)?\s*$
Example:

"example"

stop

The stop field on OpenAIChatCompletionRequest.

Minimum string length: 1
Example:

"example"

store
boolean | null

The store field on OpenAIChatCompletionRequest.

Example:

false

stream
boolean

The stream field on OpenAIChatCompletionRequest.

Example:

true

stream_options
object

The stream_options field on OpenAIChatCompletionRequest.

Example:
temperature
number

The temperature field on OpenAIChatCompletionRequest.

Example:

0.5

tool_choice

The tool_choice field on OpenAIChatCompletionRequest.

Available options:
auto,
none,
required
Example:

"auto"

tools
object[]

The tools field on OpenAIChatCompletionRequest.

Nested schema within OpenAIChatCompletionRequest for OpenAIChatCompletionRequest.tools.items.

Example:
top_logprobs
integer | null

The top_logprobs field on OpenAIChatCompletionRequest.

Example:

0

top_p
number

The top_p field on OpenAIChatCompletionRequest.

Example:

0.5

user
string

The user field on OpenAIChatCompletionRequest.

Example:

"example"

verbosity
string | null

The verbosity field on OpenAIChatCompletionRequest.

Pattern: ^\s*([Ll][Oo][Ww]|[Mm][Ee][Dd][Ii][Uu][Mm]|[Hh][Ii][Gg][Hh])?\s*$
Example:

"example"

web_fetch
boolean

The web_fetch field on OpenAIChatCompletionRequest.

Example:

true

web_search

The web_search field on OpenAIChatCompletionRequest.

Example:

true

web_search_options
null

The web_search_options field on OpenAIChatCompletionRequest.

Example:

null

Response

Chat completion JSON or server-sent event stream.

Schema for ChatCompletion values returned by or accepted by the Nito gateway.

choices
object[]
required

The choices field on ChatCompletion.

Example:
created
integer
required

The created field on ChatCompletion.

Example:

1778268600

id
string
required

The id field on ChatCompletion.

Example:

"00000000-0000-4000-8000-000000000001"

model
string
required

The model field on ChatCompletion.

Example:

"openai/gpt-5.5"

object
string
required

The object field on ChatCompletion.

Example:

"example"

usage
object
required

The usage field on ChatCompletion.

Example:
account_ref
string

Deployment-scoped, non-reversible account comparison label; not a raw identifier.

Pattern: ^nref_[0-9a-f]{24}$
Example:

"nref_0123456789abcdef01234567"

credential_ref
string

Deployment-scoped, non-reversible credential comparison label; not a raw identifier.

Pattern: ^nref_[0-9a-f]{24}$
Example:

"nref_0123456789abcdef01234567"

free_tier
object

The free_tier field on ChatCompletion.

Example:

"example"

free_tier_reservation
string<uuid>

The free_tier_reservation field on ChatCompletion.

Example:

"example"

nito_operation_id
string<uuid>

The nito_operation_id field on ChatCompletion.

Example:

"00000000-0000-4000-8000-000000000001"

organization_ref
string

Deployment-scoped, non-reversible organization comparison label; not a raw identifier.

Pattern: ^nref_[0-9a-f]{24}$
Example:

"nref_0123456789abcdef01234567"

system_fingerprint
string | null

The system_fingerprint field on ChatCompletion.

Example:

"example"

The web_search field on ChatCompletion.

Example:
response_evidence
object

Optional original exchange and signature evidence for client verification. Returned only when requested on a supported nonstreaming Encrypted call.

Example: