Kimi K3 API
https://api.hiapi.ai /v1/chat/completions This model uses an OpenAI-compatible Chat Completions endpoint. The same HiAPI API key can call enabled models in your account group; image, video, and audio models use /v1/tasks and a different request shape.
Model overview
| Model name | kimi-k3 |
|---|---|
| Provider | Moonshot AI |
| Type | Text generation · Chat Completions |
| Context | 1M tokens |
| Reasoning | Always on · low/high/max |
| Pricing | Live HiAPI token rates |
Kimi K3 is Moonshot AI’s reasoning model with a 1M-token context window. HiAPI exposes its text Chat Completions integration with always-on reasoning, streaming, structured output, tools, and cache reads.
Production guidance
- Send POST /v1/chat/completions with model=kimi-k3 and messages. The same HiAPI API key works across enabled models; media models use /v1/tasks with a different request shape.
- Reasoning is always enabled. Use top-level reasoning_effort=low, high, or max; max is the default. Do not send thinking.type, temperature, or top_p.
- Keep the complete assistant history, including reasoning_content and tool_calls, when continuing a conversation.
Best suited for
Use the 1M-token context window for large documents and multi-turn application context.
messagesCompare low, high, and max for the quality and latency your task needs.
reasoning_effortDeclare functions, execute returned calls in your application, then continue with tool results.
toolstool_choiceRequest parameters
model string required Use this exact public model ID.
messages array required Conversation history in order. Preserve complete assistant messages returned by the API.
role enum required content string | null optional Text content. Assistant tool-call messages may have null content.
reasoning_content string optional Returned assistant reasoning content; preserve it when continuing the conversation.
tool_calls array optional Returned assistant tool calls; execute them in your application and replay the original message.
tool_call_id string optional Required on a tool result and must match the assistant tool call ID.
stream boolean optional Set true for Server-Sent Events.
stream_options object optional Options for streaming responses.
include_usage boolean optional Set true to include usage in the final streaming chunk.
reasoning_effort enum optional Always-on reasoning effort. There is no medium or none value.
max_tokens integer optional Optional output budget. The maximum output limit is not published on this page.
response_format object optional Supports json_object and strict json_schema output.
tools array optional OpenAI-compatible function definitions.
tool_choice string | object optional Use auto or a compatible explicit choice.
API examples
Request examples
Use the shared request shape with stream=true and include usage in the final SSE chunk.
{
"model": "kimi-k3",
"messages": [
{
"role": "user",
"content": "Explain how an HTTP cache works in three short paragraphs."
}
],
"reasoning_effort": "max",
"stream": true,
"stream_options": {
"include_usage": true
}
}Use low when latency and output usage matter more for a routine task.
{
"model": "kimi-k3",
"messages": [
{
"role": "user",
"content": "Explain how an HTTP cache works in three short paragraphs."
}
],
"reasoning_effort": "low",
"stream": false
}Use high for a multi-step analysis task.
{
"model": "kimi-k3",
"messages": [
{
"role": "user",
"content": "Explain how an HTTP cache works in three short paragraphs."
}
],
"reasoning_effort": "high",
"stream": false
}Execute the returned function call yourself, then replay the assistant call and matching tool result.
{
"model": "kimi-k3",
"messages": [
{
"role": "user",
"content": "What is the status of task demo-123?"
}
],
"reasoning_effort": "max",
"stream": false,
"tools": [
{
"type": "function",
"function": {
"name": "get_task_status",
"description": "Look up a task by ID.",
"parameters": {
"type": "object",
"properties": {
"task_id": {
"type": "string"
}
},
"required": [
"task_id"
],
"additionalProperties": false
}
}
}
],
"tool_choice": "auto"
}Request a JSON object and parse the final content after validating its fields.
{
"model": "kimi-k3",
"messages": [
{
"role": "user",
"content": "Return a JSON object with a single string field named summary about HTTP caching."
}
],
"reasoning_effort": "max",
"stream": false,
"response_format": {
"type": "json_object"
}
}Constrain the business fields while parsing the final content as JSON.
{
"model": "kimi-k3",
"messages": [
{
"role": "user",
"content": "Explain how an HTTP cache works in three short paragraphs."
}
],
"reasoning_effort": "max",
"stream": false,
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "cache_summary",
"schema": {
"type": "object",
"properties": {
"summary": {
"type": "string"
}
},
"required": [
"summary"
],
"additionalProperties": false
},
"strict": true
}
}
}Response schema
Read the final answer from choices[0].message.content. The assistant message may also include reasoning_content and tool_calls. usage is the source for input, cached-read, and output token accounting; reasoning tokens are included in completion_tokens.
{
"id": "chatcmpl_example",
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "An HTTP cache stores reusable responses...",
"reasoning_content": "I will explain the cache lookup and validation flow."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"prompt_tokens_details": {
"cached_tokens": 8
},
"completion_tokens": 42,
"completion_tokens_details": {
"reasoning_tokens": 18
},
"total_tokens": 66
}
} - Read choices[0].message.content for the final text.
- For streaming, accumulate choices[0].delta.content and handle [DONE].
- Read input, cached-read, and output counts from usage.
FAQ
Which endpoint and model ID should I use?
Use POST /v1/chat/completions with model=kimi-k3.
How do I choose reasoning effort?
Use low for routine work, high for multi-step analysis, and max for difficult reasoning or coding. The default is max; medium and none are unavailable.
Can I turn reasoning off or change temperature?
No. Reasoning is always on, and this integration fixes temperature=1 and top_p=.95. Omit thinking.type, temperature, and top_p from requests.
Are reasoning tokens billed?
Yes. Reasoning is included in completion_tokens and billed as output. Use usage details instead of estimating from visible answer length.
Can I reuse an OpenAI SDK client?
Yes. Set base_url to https://api.hiapi.ai/v1, use a HiAPI API key, and call chat.completions.create with messages. Adapt reasoning_effort and preserve assistant history.
Does it support images or Responses?
This HiAPI integration currently documents text Chat Completions only. Do not copy the official vision or Responses examples into this request.
How are cache reads billed?
Check usage.prompt_tokens_details.cached_tokens returned by the request. Cache hits are not guaranteed; use the live rates on the model pricing page for the applicable token categories. View live pricing.