Kimi K2 API

Kimi K2 0711 on AIMLAPI.

Modalities
Image, TextText
In / Out price
$0.6031/$2.43per 1M
Context window
128K tokens
Released
Jul 11, 2025

Kimi K2 overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by Kimi K2 through AI/ML API

Kimi K2 specs

Model ID
moonshotai/kimi-k2
Developer
Moonshot AI
Context window
131,072 tokens
Max output
98,304 tokens
Input
Image, Text
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

Coding and code review
Generate, debug, and review code across languages, reading whole files or repos in a single prompt.

Agentic and multi-step workflows
Reliable tool-calling and instruction-following suit agent loops that plan, call tools, and iterate.

Complex reasoning
Extended reasoning improves reliability on multi-step math, logic, and technical analysis.

Long-document analysis
Summarize and extract from contracts, papers, and reports without aggressive chunking.

Use cases

  • Tool Automation: Streamlining workflows that require dynamic integration of external APIs, data services, and automated actions.
  • Enterprise Automation: Complex business processes where agents must interact with diverse digital tools and environments.
  • Multilingual Applications: Cross-cultural, multilingual scenarios demanding high context retention and nuanced understanding.
  • R&D Prototyping: Rapid experimentation with AI agents in simulated and real-world tool environments.

Capabilities

  • Function calling
  • Reasoning
  • Streaming
  • Structured outputs
  • Web search

Kimi K2 benchmarks by Artificial Analysis

See how Kimi K2 compares in generation speed and latency. Data retrieved Nov 3, 2026.

Speed

Output tokens / second

Benchmark results

Compare 10 models available on AI/ML API across 5 independent benchmarks.

Humanity's Last Exam

Expert-written questions across academic subjects.

Kimi K2 API pricing

Kimi K2 pricing in US dollars
UsagePriceUnit
Input$0.60311M tokens
Output$2.431M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

Kimi K2 vs other models: token prices

AI/ML API input and output rates for 5 models, per million tokens.

AI/ML API model prices in USD per million tokens
ModelInputOutput
Kimi K2$0.6031$2.43
Kimi K2.7 Code HighSpeed$1.9$8
Kimi K3.1 Pro$2$10
Kimi K3$3$15
Kimi K3.1 Pro Highspeed$4$20

How to use the Kimi K2 API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "moonshotai/kimi-k2",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'

Related articles

All posts

Kimi K2 FAQ

What is the context window of Kimi K2?

Kimi K2 has a 131,072 tokens context window and can return up to 100,352 tokens.

What inputs and outputs does Kimi K2 support?

Kimi K2 takes image, text as input and returns text.

What is the model ID for Kimi K2?

Use moonshotai/kimi-k2 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

How much does Kimi K2 cost?

Kimi K2 costs $0.6031 input and $2.43 output per 1M tokens on AI/ML API, billed as you go with no subscription.

Does Kimi K2 support streaming?

Yes, Kimi K2 can stream responses as they are generated.

Can Kimi K2 read images?

Yes, Kimi K2 accepts image input alongside text.

Who created Kimi K2?

Kimi K2 was built by Moonshot AI.

Does Kimi K2 have reasoning capabilities?

Yes, Kimi K2 includes reasoning as both a feature and a capability.

Can Kimi K2 call functions or use external tools?

Yes, it supports function calling, tool use, and parallel tool calls.

Start building with Kimi K2

Kimi K2 API

moonshotai/kimi-k2

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "moonshotai/kimi-k2",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'