curl --request POST \
--url https://www.anyfast.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kimi-k3",
"messages": [
{
"role": "user",
"content": "Explain Kimi K3 in one sentence."
}
],
"reasoning_effort": "max"
}
'{
"id": "cmpl-kimi-k3-example",
"object": "chat.completion",
"created": 1784736000,
"model": "moonshotai/kimi-k3",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"reasoning": "The user requested a concise introduction.",
"reasoning_details": [
{
"type": "reasoning.text",
"text": "The user requested a concise introduction.",
"format": "unknown",
"index": 0
}
],
"content": "Kimi K3 is Moonshot AI's flagship multimodal reasoning model with a 1M-token context window."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 18,
"completion_tokens": 32,
"total_tokens": 50,
"prompt_tokens_details": {
"cached_tokens": 0
}
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}kimi-k3
根据对话历史生成 Kimi K3 响应。K3 支持 100 万 Token 上下文、文本/图片输入、 始终开启的思考、流式输出、结构化输出、Partial Mode 和函数工具。使用 reasoning_effort 配置推理强度;K2.x 的 thinking 对象不会生效。不要传入固定采样参数。
curl --request POST \
--url https://www.anyfast.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kimi-k3",
"messages": [
{
"role": "user",
"content": "Explain Kimi K3 in one sentence."
}
],
"reasoning_effort": "max"
}
'{
"id": "cmpl-kimi-k3-example",
"object": "chat.completion",
"created": 1784736000,
"model": "moonshotai/kimi-k3",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"reasoning": "The user requested a concise introduction.",
"reasoning_details": [
{
"type": "reasoning.text",
"text": "The user requested a concise introduction.",
"format": "unknown",
"index": 0
}
],
"content": "Kimi K3 is Moonshot AI's flagship multimodal reasoning model with a 1M-token context window."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 18,
"completion_tokens": 32,
"total_tokens": 50,
"prompt_tokens_details": {
"cached_tokens": 0
}
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}reasoning_effort;K2.x 的 thinking 对象不会生效。采样参数为固定值,请省略 temperature、top_p、n、presence_penalty 和 frequency_penalty。授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
模型 ID,固定为 kimi-k3。
kimi-k3 对话历史。后续轮次必须完整传回 assistant 消息,包括 reasoning、reasoning_details 和 tool_calls。
1Show child attributes
Show child attributes
控制推理强度。K3 始终开启思考与 Preserved Thinking,无法关闭思考。
low, high, max 最大输出 Token 数。输入与输出之和不能超过 100 万 Token 上下文窗口。 max_tokens 已弃用。
1 <= x <= 1048576Show child attributes
Show child attributes
最多 5 个停止字符串,每个字符串不超过 32 字节。停止词可能在最终内容生成前终止推理。
是否通过 Server-Sent Events 流式返回增量内容。
流式响应选项。
Show child attributes
Show child attributes
可供模型调用的函数工具列表。
Show child attributes
Show child attributes
让模型自行决定、禁用工具调用,或要求至少调用一个工具。
auto, none, required 稳定的会话或任务标识,用于提高前缀缓存命中率。
最终用户的稳定标识。建议使用哈希值,不要传入可直接识别用户的信息。
响应
成功生成响应。stream 为 true 时通过 SSE 返回 chat.completion.chunk, 并以 data: [DONE] 结束。
此页面对您有帮助吗?