Skip to content

Moonshot AI

Kimi K2.7 Code

Tuned for writing and editing code.

moonshotai/kimi-k2.7-code
Input → Output
Text, images → Text/Text
Maximum input
190K tokens
Provider
2
Tool invocation
Yes

Price per million tokens

Input
1,539 credits
Output
6,480 credits
Cached input reads
307.8 credits

Provider

Several providers serve the same model. We try providers in order and move to the next if one cannot respond. Performance is measured on actual AlpRouter requests over the last seven days, and uptime over the last three.

ProviderInput / 1MOutput / 1MCache readFirst tokenThroughputUptime
Microsoft Foundry1,539 credits6,480 credits307.8 credits---
Alibaba Cloud1,539 credits6,480 credits307.8 credits---

Time to first token and throughput are medians (P50). Values are hidden for fewer than 10 requests.

Performance

The “throughput” refers to the speed at which answers are written (the higher the better). The “first token” refers to the time it takes for the first character of the answer to appear (the lower the better). The “total time” refers to the time it takes for one request to be processed completely. The average value is calculated based on the last 7 requests of the user with ID 13.

Total duration
2.89 seconds
Alibaba Cloud

Use the API

from openai import OpenAI

client = OpenAI(
    base_url="https://alprouter.com/api/v1",
    api_key="alp-your-key",
)

answer = client.chat.completions.create(
    model="moonshotai/kimi-k2.7-code",
    messages=[{"role": "user", "content": "Hello"}],
)
print(answer.choices[0].message.content)

Details

Maximum input
190K tokens
Scheduled retirement
2027.04.16 (date set by the provider)
Maximum output
64K tokens
Tool invocation
Supported
Supported input
Text, images
Output
Text/Text
Provider
Microsoft Foundry, Alibaba Cloud
Supported parameters
frequency_penalty, max_completion_tokens, max_tokens, n, parallel_tool_calls, presence_penalty, reasoning_effort, response_format, seed, stop, stream, temperature, tool_choice, tools, top_p

Frequently asked questions

What kind of model is Kimi K2.7 Code?

A model from Moonshot AI. Tuned for writing and editing code. Model ID on AlpRouter: moonshotai/kimi-k2.7-code

How much does Kimi K2.7 Code cost?

Per million tokens: 1,539 credits input, 6,480 credits output. One credit equals ₩1. Only usage is deducted from your balance. There is no monthly subscription.

How much input does Kimi K2.7 Code accept?

Each request accepts up to 190K tokens. The maximum output is 64K tokens.

What input and output does Kimi K2.7 Code support?

Send Text, images to receive Text/Text.

Does Kimi K2.7 Code support tool calling and structured JSON?

Tool calling: Supported. Structured output (response_format): Supports the json_object, json_schema format..

Which providers handle Kimi K2.7 Code requests?

Microsoft Foundry, Alibaba Cloud handles these requests. If a provider cannot respond, another provider takes over.

How do I call Kimi K2.7 Code from code?

Just replace the base_url in the OpenAI SDK with https://alprouter.com/api/v1. Also, specify the name of the model in the model field (moonshotai/kimi-k2.7-code). There’s an example of how to do this in the “Using the API” section above.

Other models from Moonshot AI