Skip to main content
POST
创建 Chat Completion

授权

Authorization
string
header
必填

在控制台 API Key 页面创建的 key,通过请求头 Authorization: Bearer <key> 传入。

请求体

application/json
model
string
必填

模型 ID,例如 moonshotai/Kimi-K3。

示例:

"moonshotai/Kimi-K3"

messages
object[]
必填
Minimum array length: 1
max_tokens
integer | null
必填范围: x >= 1
max_completion_tokens
integer | null
必填范围: x >= 1
temperature
number | null
默认值:1
必填范围: 0 <= x <= 2
top_p
number | null
默认值:1

生产环境的 Kimi-K3 要求取值在 [0.95, 1.0] 范围内。

必填范围: 0 <= x <= 1
top_k
integer | null

非 OpenAI 标准参数,LithosAI 支持。

n
integer | null
默认值:1

Kimi-K3 只支持 1。

stop
stream
boolean | null
默认值:false
stream_options
object | null
presence_penalty
number | null
默认值:0

Kimi-K3 只支持 0.0。

必填范围: -2 <= x <= 2
frequency_penalty
number | null
默认值:0

Kimi-K3 只支持 0.0。

必填范围: -2 <= x <= 2
seed
integer | null
logprobs
boolean | null
top_logprobs
integer | null
logit_bias
object | null
response_format
object | null
reasoning_effort
string | null
tools
object[]
tool_choice
user
string

响应

返回生成结果;stream 为 true 时返回 SSE 流。

id
string
必填
object
string
必填
Allowed value: "chat.completion"
created
integer<unixtime>
必填
model
string
必填
choices
object[]
必填
usage
object