curl --request POST \
--url https://direct.evolink.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kimi-k3.1-pro",
"max_tokens": 1024,
"output_config": {
"effort": "low"
},
"messages": [
{
"role": "user",
"content": "Reply with OK."
}
]
}
'{
"id": "<string>",
"type": "message",
"role": "assistant",
"model": "kimi-k3.1-pro",
"content": [
{
"type": "text",
"text": "<string>"
}
],
"stop_reason": "end_turn",
"stop_sequence": "<string>",
"usage": {
"input_tokens": 123,
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"output_tokens": 123,
"output_tokens_details": {
"thinking_tokens": 123
},
"cache_creation": {
"ephemeral_5m_input_tokens": 1,
"ephemeral_1h_input_tokens": 1
},
"server_tool_use": {
"web_search_requests": 1
}
}
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}Kimi 全模型接口 - Messages 完整参数
对外路径 POST /v1/messages。思考档位放在 output_config.effort;顶层 cache_control 控制 5m/1h 写入(仅 K3.1 系列)。完整保留 thinking、signature、tool_use 和服务端搜索结果块。
curl --request POST \
--url https://direct.evolink.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kimi-k3.1-pro",
"max_tokens": 1024,
"output_config": {
"effort": "low"
},
"messages": [
{
"role": "user",
"content": "Reply with OK."
}
]
}
'{
"id": "<string>",
"type": "message",
"role": "assistant",
"model": "kimi-k3.1-pro",
"content": [
{
"type": "text",
"text": "<string>"
}
],
"stop_reason": "end_turn",
"stop_sequence": "<string>",
"usage": {
"input_tokens": 123,
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123,
"output_tokens": 123,
"output_tokens_details": {
"thinking_tokens": 123
},
"cache_creation": {
"ephemeral_5m_input_tokens": 1,
"ephemeral_1h_input_tokens": 1
},
"server_tool_use": {
"web_search_requests": 1
}
}
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
},
"request_id": "<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,均始终开启思考。
结构化输出(output_config.format)、停用词(stop_sequences)和缓存写入时长(cache_control)仅 K3.1 系列支持,kimi-k3 不支持。kimi-k3 的响应可能只包含 text 块,不返回 thinking 块。
kimi-k3.1-pro, kimi-k3.1-pro-highspeed, kimi-k3 本次生成允许使用的最大 Token 数,包含 thinking 与最终文本。
1 <= x <= 1048576Anthropic Messages 消息列表。多轮对话需原样回传完整 assistant 内容块。
1Show child attributes
Show child attributes
系统提示,可为字符串或 text 块数组
是否使用 Anthropic SSE 事件流返回。
自定义函数或服务端联网搜索。内置搜索使用 type=web_search_20250305、name=web_search;实际调用按次收费。
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
停用词,完全匹配时停止输出,匹配到的词本身不会被输出。最多 5 个,每个不超过 32 字节。命中时 stop_reason 返回 end_turn,stop_sequence 为 null。
仅 kimi-k3.1-pro / kimi-k3.1-pro-highspeed 支持,kimi-k3 不支持。
5顶层缓存写入选项,仅 kimi-k3.1-pro / kimi-k3.1-pro-highspeed 支持,kimi-k3 不支持此参数。只有顶层 cache_control 控制写入 TTL,消息块内的缓存标记不能代替此字段。省略时默认为 5m。
Show child attributes
Show child attributes
输出配置:推理强度与结构化输出
Show child attributes
Show child attributes
采样温度,由模型固定为 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 传入不支持的取值将返回错误。
响应
Message 响应;流式请求返回 Anthropic SSE 事件流
message assistant "kimi-k3.1-pro"
Anthropic 内容块,可用于文本、图片、推理、工具调用或工具结果。
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
Show child attributes
Show child attributes
end_turn, max_tokens, tool_use, refusal, null Show child attributes
Show child attributes