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
Onlymessages is required.
n: 1 and store: false are accepted as no-ops. n above 1, store: true, and audio output are rejected. The same feature sent twice (for example web_search as a field and as a tool) is 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 hasrole 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 setmodel can carry a few controls in the ID: z-ai/glm-5.2?reasoning_effort=high, moonshotai/kimi-k3?web_search=auto. Suffix and body must agree when both are present. The suffix is stripped before routing. See Model ID Convention.
Example
:confidential variant, for example "model": "moonshotai/kimi-k3:confidential". GET /v1/models lists their :confidential IDs. See Privacy Levels.
Response
- Exactly one choice. Read
choices[0]. finish_reason:stop,length,tool_calls, orerror.system_fingerprintis alwaysnull.usage:prompt_tokens,completion_tokens,total_tokens, plusreasoning_tokens,server_tool_use, cached-token details, andcustomer_costwhen relevant. See Check Usage.
Errors
Validation problems return400 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
POST /v1/messagesfor Anthropic-shaped clients. See the Anthropic drop-in.POST /v1/responsesfor stateless Responses-API clients. See the Responses reference.
Related
Tool Calling
Function calls.
Reasoning
Think first.
Streaming
Token by token.
Privacy Levels
The four levels.
Chat Completions Endpoint
Schema reference.
Model ID Convention
IDs and suffixes.

