Skip to main content
POST
创建对话补全

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
model
string
必填
示例:

"gpt-5.4"

messages
object[]
必填
temperature
number

采样温度。

必填范围: 0 <= x <= 2
top_p
number

核采样累计概率。

必填范围: 0 <= x <= 1
max_tokens
integer
已弃用

max_completion_tokens 的兼容旧别名。APIAny 仅在所选模型路由需要新字段时转换。

必填范围: x >= 1
max_completion_tokens
integer

思考过程与最终答案合计的最大 Token 数。Kimi K3 省略时默认 131072,最高支持 1048576。

必填范围: 1 <= x <= 1048576
reasoning_effort
enum<string>

Kimi K3 的思考强度。K3 始终思考,目前仅支持 max。

可用选项:
max
stop

最多 4 个停止序列。

n
integer

生成候选条数。

必填范围: x >= 1
frequency_penalty
number
必填范围: -2 <= x <= 2
presence_penalty
number
必填范围: -2 <= x <= 2
seed
integer

尽量可复现的采样种子。

response_format
object

强制 JSON 对象或 JSON Schema 输出,如 { "type": "json_object" }。

tools
object[]

模型可调用的工具/函数声明。

tool_choice

工具选择:'auto' | 'none' | 'required' | { type: 'function', function: { name } }。

logprobs
boolean
top_logprobs
integer
必填范围: 0 <= x <= 20
logit_bias
object
user
string

终端用户标识,用于风险审计。

stream
boolean

为 true 时通过 SSE 流式返回增量(OpenAI chat.completion.chunk),以 'data: [DONE]' 结束。

响应

OpenAI 兼容的对话补全响应。

id
string
必填
object
string
必填
示例:

"chat.completion"

created
integer
必填
model
string
必填
choices
object[]
必填
usage
object