Introduction
Kimi K3 is Moonshot AI's long-context agent model, served here on one OpenAI-compatible endpoint at /v1/chat/completions. It reads up to 1,000,000 tokens across at most 256 messages and can return up to 1,048,576 tokens in one reply.
The request surface is seven fields: messages, max_tokens, tools, tool_choice, response_format, reasoning_effort and stop. Effort takes low, high or max and starts at max; temperature and top_p are fixed by Moonshot and rejected here. Messages can carry text and image_url parts, and replies stream over Server-Sent Events.
Key features & highlights
reasoning_effort is the one dial
With sampling fixed by Moonshot, the setting you control is how hard the model works: low for short mechanical turns, high for ordinary review, max for migrations and proofs. A sampling value copied from another model fails fast instead of being silently ignored, so a request means the same thing in every environment.
Read a package, return a file
One million tokens in and up to 1,048,576 back means the codebase goes in whole and a rewritten file can come back whole. Every pass still sees the rest of the repository, which is the context that chunked pipelines usually lose.
Text and images in the same message
A user message can mix text and image_url parts with a detail setting of auto, low or high, and every part is metered as input tokens. A screenshot of a failing screen and the source that renders it can go to the model together; there is no video part.
Request parameters
| Parameter | Required | Description |
|---|---|---|
messages | Yes | At most 256 ordered turns. Content is a plain string or an array of parts: text, and |
max_tokens | No | Caps the reply at 1,048,576. The default of 32,768 can still truncate a whole-file rewrite silently - size it to the artefact. |
reasoning_effort | No | low, high or max, default max - the levels and default Moonshot documents for K3, so a request that omits the field already gets the most careful setting. |
stop | No | Up to 4 sequences of at most 32 bytes each, as a string or an array. The reply ends as soon as the model writes one of them, and the matched text itself is left out. at least 1 characters · at least 1 items · at most 4 items |
tools | No | Up to 128 function definitions, declared on the first request of a loop. at most 128 items |
tool_choice | No | auto lets the model skip a call; required forces one; none forbids all of them. |
response_format | No | Ask for a JSON object when the output is structured data rather than prose. |
Pricing
Input $2.70 / Output $13.50 per 1 million tokens
Use cases
Repository-wide rewrites, file by file
Send every file in a package and ask for one migrated file at a time rather than a description of the diff. The large reply ceiling carries a big file back whole, so nothing is lost at a continuation boundary halfway through a function.
Agent loops with a fixed surface
Declare up to 128 tools, leave tool_choice on auto and run the loop. Fix reasoning_effort for the whole loop, and the only thing that changes between iterations is the conversation, which keeps an agent trace readable when something goes wrong.
Whole-book translation and restructuring
Load a full manuscript and a glossary, then ask for one translated or restructured chapter per call while the model still sees the rest of the book. Terms and names stay consistent because the earlier chapters are in the same request.
Prompt guide & pro tips
Pick the effort level on purpose
An omitted reasoning_effort already means max - the most careful setting and the most output tokens. Decide per task: max for a migration or a proof, high for review, low for short mechanical turns.
Ask for the artefact, not a description of it
POST https://api.spicyapi.ai/v1/chat/completions with {"model": "moonshot/kimi-k3", "messages": [{"role": "system", "content": "Return the migrated files in full. No commentary, no diffs, no omitted regions."}, {"role": "user", "content": "<every file in the package>"}], "max_tokens": 120000}. Size max_tokens to the file you expect back: the default of 32,768 can truncate a whole-file rewrite without raising an error.
Streaming and limits
A non-streamed call at max on a full window can run long, so stream it or size the client timeout. The window is 1,000,000 tokens, max_tokens above 1,048,576 is invalid, and temperature or top_p in the body fails validation.
API quick start
curl --fail-with-body -sN https://api.spicyapi.ai/v1/chat/completions \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "moonshot/kimi-k3/chat",
"messages": [
{
"role": "user",
"content": "Summarise the following release notes into three bullet points."
}
],
"stream": true
}' \
| jq --unbuffered -Rrj 'select(startswith("data: ")) | .[6:] | select(. != "[DONE]") | fromjson | if .error then "\n[error] \(.error.message)\n" else (.choices[0].delta.content? // empty) end'
See the API reference for authentication, the complete schema, polling, and error handling.





