Kimi K2 API is an openโsource, trillionโparameter MixtureโofโExperts language model with a 256Kโtoken context window, optimized for highโperformance coding, agentic reasoning, and efficient inference.
Kimi K2-0905 is the latest AI model released by Darkside of the Moon Technology Co., Ltd. It boasts powerful programming assistance capabilities, excelling in code generation and front-end development. Its context length is extended to 256KB, supporting complex tasks. The high-speed API output speed of the model reaches 60โ100 tokens/second, ensuring fast response times.
The model is compatible with the Anthropic API, supports the WebSearch Tool, and offers an enhanced Claude Code experience. It also provides automatic context caching to reduce user costs. Users can now experience it through CometAPI (kimi-k2-250905).
Basic Information & Features
- Model Name: KimiโฏK2
- Architecture: MixtureโofโExperts (MoE)
- Total Parameters: 1โฏtrillion
- Activated Parameters: 32โฏbillion per forward pass
- Context Length: 256โฏK tokens
- Vocabulary Size: 160โฏK tokens
- Primary Use Cases: Coding, tool integration, complex task decomposition, general reasoning.
Technical Architecture
KimiโฏK2 employs a 384โexpert MoE design, selecting 8 experts per token to balance performance with inference efficiency. It comprises 61 layers, including 1 dense layer, and utilizes MultiโLayer Attention (MLA) alongside the SwiGLU activation function. Training leveraged the Muon optimizer over 15.5โฏtrillion tokens, ensuring stability and high throughput across diverse benchmarks.
Benchmark Performance
- SWEโbench Verified: 65.8% singleโattempt accuracyโsurpassing GPTโ4.1โs 54.6% and trailing only ClaudeโฏSonnetโฏ4 among top models.
- Multilingual SWEโbench: 47.3% accuracy, leading openโsource contenders.
- LiveCodeBench: 53.7%, the highest among nonโproprietary models.
- EvalPlus: 80.3, outperforming DeepSeekโV3 and Qwenโฏ2.5 series.
These results underscore KimiโฏK2โs stateโofโtheโart coding proficiency and robust reasoning capabilities.

How to call KimiโฏK2 API from CometAPI
KimiโฏK2ย API Pricing in CometAPI๏ผ20% off the official price:
- Input Tokens:ย $0.11/ย Mย tokens
- Output Tokens:ย $1.99/ย Mย tokens
Required Steps
- Log in toย cometapi.com. If you are not our user yet, please register first
- Get the access credential API key of the interface. Click โAdd Tokenโ at the API token in the personal center, get the token key: sk-xxxxx and submit.
- Get the url of this site:ย
https://api.cometapi.com/
Use Method
- Select the โ
kimi-k2-0711-previewโ endpoint to send the API request and set the request body. The request method and request body are obtained from our website API doc. Our website also provides Apifox test for your convenience. - Replace <YOUR_API_KEY> with your actual CometAPI key from your account.
- Insert your question or request into the content fieldโthis is what the model will respond to.
- . Process the API response to get the generated answer.
CometAPI provides a fully compatible REST APIโfor seamless migration. Key details to API doc:
- Base URL:ย
https://api.cometapi.com/v1/chat/completions - Model Names:ย โ
kimi-k2-250905โ - Authentication:ย Bearer token viaย
Authorization: Bearer YOUR_CometAPI_API_KEYย header - Content-Type:ย
application/jsonย .
API Integration & Examples
KimiโฏK2 is accessible via CometAPI (OpenAIโcompatible) and the Moonshot AI API. Below is a Python snippet for a ChatCompletion call through CometAPI:
Python snippet for a ChatCompletion call through CometAPI:
pythonimport openai
openai.api_key = "YOUR_CometAPI_API_KEY"
openai.api_base = "https://api.cometapi.com/v1/chat/completions"
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Summarize Kimi K2's main features."}
]
response = openai.ChatCompletion.create(
model="kimi-k2-250905",
messages=messages,
temperature=0.7,
max_tokens=500
)
print(response.choices.message)
