/v1/chat/completions for OpenAI-compatible text generation.
Streaming
Setstream: true to receive server-sent events. Each event is an OpenAI
chat.completion.chunk, and the stream ends with data: [DONE].
Parameters
OpenAI-standard parameters are accepted, includingtemperature, top_p,
max_tokens, max_completion_tokens, stop, n, frequency_penalty, presence_penalty, seed,
response_format, tools, tool_choice, logprobs, top_logprobs,
logit_bias, user, and stream.
Kimi K3 compatibility
kimi-k3 uses the same OpenAI-compatible endpoint, but its native contract has
model-specific rules:
- K3 always reasons. Use top-level
reasoning_effort: "max"; the K2.xthinkingobject is accepted only as an enabled compatibility alias. - Prefer
max_completion_tokens. APIAny accepts deprecatedmax_tokensand converts it only when the selected route targets Kimi K3. If no limit is provided, Kimi’s official default is used. The explicit maximum is 1,048,576 tokens. - K3 sampling is fixed by the provider. APIAny removes
temperature,top_p,frequency_penalty, andpresence_penaltyonly for K3;nmust be1. reasoning_contentis the reasoning trace andcontentis the final answer. Streaming returns them as separate deltas. Do not merge the reasoning trace into the final answer.- Replay the complete assistant message, including
reasoning_contentandtool_calls, in multi-turn and tool-calling requests. - The last assistant message may use
partial: true. A content-less system message may carrytoolsto load K3 tools dynamically. - K3 image/video content blocks must use a Base64
data:URL or anms://file ID. Public HTTP media URLs are rejected before the model request is sent.
finish_reason is length, the output budget was exhausted. The response
is still OpenAI-compatible, but the final answer may be missing or incomplete;
increase max_completion_tokens or reduce the input before retrying.
Notes
- The
modelis a public APIAny.AI model ID. - Token usage is normalized into the OpenAI-style
usageobject when usage data is available.