curl --request POST \
--url https://direct.evolink.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kimi-k3.1-pro",
"messages": [
{
"role": "user",
"content": "Reply with OK."
}
],
"reasoning_effort": "low",
"max_completion_tokens": 1024
}
'{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "kimi-k3.1-pro",
"choices": [
{
"index": 123,
"message": {
"role": "system",
"content": "<string>",
"reasoning_content": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
],
"tool_call_id": "<string>"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {
"cached_tokens": 123,
"cache_write_tokens": 1
},
"completion_tokens_details": {
"reasoning_tokens": 123
}
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Kimi 全模型接口 - Chat Completions 完整参数
使用 OpenAI Chat Completions 格式调用 Kimi 系列模型,支持普通 JSON 和 SSE 流式响应。多轮对话请完整保留 assistant 消息中的 reasoning_content 和 tool_calls。
联网搜索返回 tool_calls 时,将每个调用的 function.arguments 作为相同 tool_call_id 的 tool 消息内容回传,继续请求以生成最终回答。
curl --request POST \
--url https://direct.evolink.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kimi-k3.1-pro",
"messages": [
{
"role": "user",
"content": "Reply with OK."
}
],
"reasoning_effort": "low",
"max_completion_tokens": 1024
}
'{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "kimi-k3.1-pro",
"choices": [
{
"index": 123,
"message": {
"role": "system",
"content": "<string>",
"reasoning_content": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
],
"tool_call_id": "<string>"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {
"cached_tokens": 123,
"cache_write_tokens": 1
},
"completion_tokens_details": {
"reasoning_tokens": 123
}
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}https://direct.evolink.ai,对文本模型支持更好,支持长连接;https://api.evolink.ai 是多模态主力地址,对文本模型作为备用地址使用。授权
##所有接口均需要使用 Bearer Token 进行认证##
获取 API Key:
访问 API Key 管理页面 获取您的 API Key
使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
要调用的模型:
| 模型 ID | 定位 | 思考强度 |
|---|---|---|
kimi-k3.1-pro | 最新一代模型(推荐) | low / high / max,默认 max |
kimi-k3.1-pro-highspeed | 与 Pro 参数相同,生成速度更快 | 同 kimi-k3.1-pro |
kimi-k3 | 上一代模型 | 仅支持 max |
三个模型的上下文窗口均为 1,048,576 tokens,均始终开启思考。
缓存写入时长(prompt_cache_options)仅 K3.1 系列支持,kimi-k3 不支持此参数。
kimi-k3.1-pro, kimi-k3.1-pro-highspeed, kimi-k3 对话消息。多轮对话需完整回传历史 assistant message。
1Show child attributes
Show child attributes
最大生成 Token 数,包含思考与最终回答;默认 131072,最大 1048576,同时受剩余上下文限制。
1 <= x <= 1048576思考强度,模型始终思考。
kimi-k3.1-pro/kimi-k3.1-pro-highspeed:推荐low/high/max,默认max。兼容通用客户端:medium按high,xhigh按max,minimal/none按low处理;none不会关闭思考。kimi-k3:仅支持max(默认)。
提高强度通常增加推理 Token 和延迟,思考 Token 计入输出。
low, high, max, medium, xhigh, minimal, none 是否使用 SSE 流式返回。
函数工具或联网搜索工具。联网搜索使用 {"type":"web_search"}。
128- Option 1
- Option 2
Show child attributes
Show child attributes
控制模型是否调用工具,或强制调用指定函数。
auto, none, required 上下文缓存写入选项,仅 kimi-k3.1-pro / kimi-k3.1-pro-highspeed 支持,kimi-k3 不支持此参数。省略时默认自动写入 5m 缓存;写入、读取分别计费。
Show child attributes
Show child attributes
输出格式:text 为普通文本,json_object 返回 JSON 对象,json_schema 按指定的 JSON Schema 生成结构化结果。
Show child attributes
Show child attributes
兼容旧客户端的输出上限别名;新请求使用 max_completion_tokens,避免同时设置。
1 <= x <= 1048576采样温度,由模型固定为 1,无需传入。kimi-k3.1-pro / kimi-k3.1-pro-highspeed 会自动忽略此字段;kimi-k3 传入不支持的取值将返回错误。
核采样阈值,由模型固定为 0.95,无需传入。kimi-k3.1-pro / kimi-k3.1-pro-highspeed 会自动忽略此字段;kimi-k3 传入不支持的取值将返回错误。