Skip to main content
Send a list of messages, name a model, get a reply in the OpenAI chat-completions shape. The model ID says whether the call is end-to-end encrypted.

Endpoint

POST /v1/chat/completions accepts OpenAI-compatible requests. Unknown fields at gateway-owned objects are dropped for compatibility. A control the model cannot honor returns 400 invalid_request before any usage is reserved.

Request

Only messages is required. n: 1 and store: false are accepted as no-ops. n above 1, store: true, and audio output are rejected. Two tools entries of the same type are rejected. A model’s supported optional controls are in supported_parameters on its catalog entry. The supports query can filter for controls such as json_mode; structured_outputs qualifies response_format rather than naming a top-level request field. See Model Discovery.

Messages

Each message has role and content. Roles: system, user, assistant, tool, developer. A tool message pairs with a tool_call_id. content is a string or an array of parts for multimodal input.

Suffixes on the Model ID

Clients that can only set model can carry a few controls in the ID: moonshotai/kimi-k3.1-pro:confidential?reasoning_effort=high, moonshotai/kimi-k3.1-pro:confidential?web_search=auto. Suffix and body must agree when both are present. The suffix is stripped before routing. See Model ID Convention.

Example

Every call runs in attested hardware. For end-to-end encryption, use an :encrypted ID with the encryption headers. See Enabling End-to-End Encryption.

Response

  • Exactly one choice. Read choices[0].
  • finish_reason: stop, length, tool_calls, or error.
  • system_fingerprint is always null.
  • usage: prompt_tokens, completion_tokens, total_tokens, plus reasoning_tokens, server_tool_use, cached-token details, and customer_cost when relevant. See Check Usage.

Errors

Validation problems return 400 with {"error": {"message", "code", "param"}}. Non-POST requests return 405 with Allow. All responses carry Cache-Control: no-store. See the error reference.

Other Text Endpoints

Tool Calling

Function calls.

Reasoning

Think first.

Streaming

Token by token.

How Privacy Works

Privacy-preserving hardware on every call.

Chat Completions Endpoint

Schema reference.

Model ID Convention

IDs and suffixes.