Kimi K2.7 Code

Kimi K2.7 Code
Moonshot AI · Text Generation
POST /v1/chat/completions

Kimi K2.7 Code is Moonshot’s trillion-parameter agentic coding model with 256K context, always-on reasoning, and text, image, and video inputs.

At a glance

FieldValue
Model idkimi-k2-7-code
Input modalitiesText, Image, Video
Output modalitiesText
Context window256K
Weight precision-
Max output tokens131,072
Featuresreasoning, function_calling, structured_output, multimodal, agentic_coding, web_search
Native inferenceNo
NewYes
Supported endpointsPOST /v1/chat/completions, POST /v1/responses, POST /v1/messages

Pricing

ChargeSpecRate
Inputper 1M prompt tokens$0.95
Outputper 1M generated tokens$4.00
Web searchper call when invoked$0.015

Example request

$curl https://api.empiriolabs.ai/v1/chat/completions \
> -H 'Authorization: Bearer $EMPIRIOLABS_API_KEY' \
> -H 'Content-Type: application/json' \
> -d '{"model": "kimi-k2-7-code", "messages": [{"role":"user","content":"Hello"}]}'

Parameters

ParameterTypeRequiredDefaultDescription
max_tokensnumberno16384Maximum output tokens. Reasoning tokens count toward this limit. · Range: 1 – 131072
stopstringno-Up to 4 strings where the model will stop generating further tokens.
response_formatobjectno-OpenAI-compatible JSON mode or JSON schema response format.
tool_web_searchbooleannofalseSearch the web for real-time information. Adds $0.015 to the request cost for each invoked web search call.

Notes

Supports text, image, and video inputs with 256K context, function calling, JSON mode structured output, and built-in web search at $0.015 per invoked call. Thinking is always on and cannot be disabled; reasoning tokens are billed as output tokens. Temperature and other sampling overrides are ignored because the model service uses fixed sampling settings. Multi-step function calling through the API must replay the assistant message with its reasoning_content field intact.

Per-tool billing (usage.tool_usage)

When this model invokes built-in tools inside a single request, the response carries a normalized usage.tool_usage map alongside the token counts. Tool counts are already factored into cost_usd and are surfaced for transparency.


Machine-readable schema: GET https://api.empiriolabs.ai/v1/models/kimi-k2-7-code.