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": 2048,
"messages": [
{
"role": "user",
"content": "Explain context caching in one sentence."
}
]
}
'{
"id": "chatcmpl-6adc72c2b5847b4b2ccb39fd",
"type": "message",
"role": "assistant",
"model": "kimi-k3.1-pro",
"content": [
{
"type": "text",
"thinking": "<string>",
"signature": "<string>",
"text": "Context caching stores repeated prefix content from requests so that later cache hits can be processed faster and at lower cost."
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 24,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0,
"output_tokens": 96
}
}{
"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 API (All Models) - Messages Quickstart
- Call Kimi models through the Anthropic Messages protocol and select a model with
model - Only
model,max_tokens, andmessagesare required (max_tokensis mandatory in the Anthropic protocol) - All three models have a context window of 1,048,576 tokens
- Reasoning is always enabled for all three models; set its intensity with
output_config.effort - For tool calling, web search, image input, structured output, or cache settings, see the full reference
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": 2048,
"messages": [
{
"role": "user",
"content": "Explain context caching in one sentence."
}
]
}
'{
"id": "chatcmpl-6adc72c2b5847b4b2ccb39fd",
"type": "message",
"role": "assistant",
"model": "kimi-k3.1-pro",
"content": [
{
"type": "text",
"thinking": "<string>",
"signature": "<string>",
"text": "Context caching stores repeated prefix content from requests so that later cache hits can be processed faster and at lower cost."
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 24,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0,
"output_tokens": 96
}
}{
"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, which has better support for text models and long-lived connections. https://api.evolink.ai is the primary endpoint for multimodal services and serves as a fallback address for text models.content usually includes type="thinking" blocks, which count toward output tokens. Avoid setting max_tokens too low: reasoning may exhaust the output budget before any answer text is produced.Authorizations
##All APIs require Bearer Token authentication##
Get API Key:
Visit API Key Management Page to get your API Key
Add to request header:
Authorization: Bearer YOUR_API_KEY
Body
Model to call:
| Model ID | Positioning |
|---|---|
kimi-k3.1-pro | Latest-generation model (recommended) |
kimi-k3.1-pro-highspeed | Same parameters as Pro, faster generation |
kimi-k3 | Previous-generation model |
All three models have a context window of 1,048,576 tokens and always have reasoning enabled.
kimi-k3.1-pro, kimi-k3.1-pro-highspeed, kimi-k3 Maximum tokens allowed for this generation, including thinking and final text. If too low, reasoning may exhaust the output budget before any answer text is produced. Use at least 1024 and increase it for more complex tasks.
1 <= x <= 1048576Conversation messages. Include historical messages in order for multi-turn conversations; see the full reference for how to return reasoning and tool-call history.
1Show child attributes
Show child attributes
System prompt. The Messages protocol uses a top-level system field instead of a system role.
Output configuration.
Show child attributes
Show child attributes
Whether to return an Anthropic SSE event stream.
Response
Message response; streaming requests return an Anthropic SSE event stream
Response ID.
"chatcmpl-6adc72c2b5847b4b2ccb39fd"
message "message"
assistant "assistant"
Model used for this call.
"kimi-k3.1-pro"
Output content blocks, usually thinking followed by text.
Show child attributes
Show child attributes
Stop reason: end_turn means a natural stop, max_tokens means the output limit was reached, and tool_use means the model is requesting a tool call.
end_turn, max_tokens, tool_use, null "end_turn"
Show child attributes
Show child attributes