Unlock exclusive introductory pricing for the newly launched Gemini 3.5 Flash.

Kimi K2 API

CometAPI
annaSep 9, 2025
Kimi K2 API

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.

kimi k2

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

  1. 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.
  2. Replace <YOUR_API_KEY> with your actual CometAPI key from your account.
  3. Insert your question or request into the content fieldโ€”this is what the model will respond to.
  4. . 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)

Ready to cut AI development costs by 20%?

Start free in minutes. Free trial credits included. No credit card required.

Read More