curl --request POST \
--url https://direct.evolink.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kimi-k3.1-pro",
"input": "Explain context caching in one sentence."
}
'{
"id": "resp_6adc72aab1f2eaaebe6b869e",
"object": "response",
"created_at": 1792832171,
"status": "completed",
"incomplete_details": {
"reason": "max_output_tokens"
},
"model": "kimi-k3.1-pro",
"output": [
{
"type": "message",
"id": "msg_6adc72aab1f2eaaebe6b869f",
"summary": [
{
"type": "summary_text",
"text": "<string>"
}
],
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Context caching stores repeated prefix content from requests so that later cache hits can be processed faster and at lower cost."
}
],
"status": "completed"
}
],
"usage": {
"input_tokens": 24,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 96,
"output_tokens_details": {
"reasoning_tokens": 62
},
"total_tokens": 120
}
}{
"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 API (All Models) - Responses Quickstart
Call Kimi with model and input. Supported models are kimi-k3.1-pro, kimi-k3.1-pro-highspeed, and kimi-k3. When setting max_output_tokens, start at 1024 to allow room for reasoning and the answer.
See the full reference for more examples and model differences.
curl --request POST \
--url https://direct.evolink.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kimi-k3.1-pro",
"input": "Explain context caching in one sentence."
}
'{
"id": "resp_6adc72aab1f2eaaebe6b869e",
"object": "response",
"created_at": 1792832171,
"status": "completed",
"incomplete_details": {
"reason": "max_output_tokens"
},
"model": "kimi-k3.1-pro",
"output": [
{
"type": "message",
"id": "msg_6adc72aab1f2eaaebe6b869f",
"summary": [
{
"type": "summary_text",
"text": "<string>"
}
],
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Context caching stores repeated prefix content from requests so that later cache hits can be processed faster and at lower cost."
}
],
"status": "completed"
}
],
"usage": {
"input_tokens": 24,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 96,
"output_tokens_details": {
"reasoning_tokens": 62
},
"total_tokens": 120
}
}{
"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, 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.POST /v1/responses and select kimi-k3.1-pro, kimi-k3.1-pro-highspeed, or kimi-k3 with model. Only model and input are required.
input for input, max_output_tokens for the output limit, and reasoning.effort for reasoning effort.Reading the answer text
The responseoutput may include reasoning, answer text, and tool calls. Iterate over the output_text content blocks within type="message" items; do not assume the first item contains the answer.
Assuming the response JSON has been parsed into response, extract the text as follows:
text = "".join(
part["text"]
for item in response.get("output", [])
if item.get("type") == "message"
for part in item.get("content", [])
if part.get("type") == "output_text"
)
print(text)
max_output_tokens includes both reasoning and the answer. If status="incomplete" and incomplete_details.reason="max_output_tokens", increase the limit. When the budget is exhausted, the response may contain only reasoning items without answer text.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 Input for this request. A string is equivalent to a single user message; an array supplies historical messages in order.
Maximum generated tokens, including reasoning and the final answer; default 131072, maximum 1048576.
1 <= x <= 1048576Reasoning configuration.
Show child attributes
Show child attributes
When true, returns the response as an SSE stream.
Response
Response created successfully; streaming requests return an SSE event stream
Response ID.
"resp_6adc72aab1f2eaaebe6b869e"
response "response"
Creation time as a Unix timestamp in seconds.
1792832171
Response status. incomplete usually means the max_output_tokens limit was reached.
completed, incomplete, failed "completed"
Reason provided when status is incomplete.
Show child attributes
Show child attributes
Model used for this call.
"kimi-k3.1-pro"
Output items, usually reasoning followed by message.
Show child attributes
Show child attributes
Show child attributes
Show child attributes