Kimi K2 0711
Open-weight text model from Moonshot AI with tool calling and a long context window. Its only benchmark result, on Terminal-Bench, sits well below the registry median.
Spec sheet
- Family
- Moonshot AI
- Released
- 11 Jul 202517 months ago
- Weights
- Open
- Context window
- 131k tokens
- Largest response
- 98k tokens
- Accepts
- text
- Supports
- tools
- Knowledge cutoff
- December 2024
- Intelligence index
- –
- Input price
- $1 / 1M
- Output price
- $3 / 1M
- Blended price (3:1)
- $1.5 / 1M
- Index points per $
- –
- Speed
- 32 tokens/sec#165
- Popularity
- #101 of 194by usage
- Providers
- 3
- Weights on
- moonshotai/Kimi-K2-Instruct
Benchmarks
Score · rank among models testedThe tick on each bar marks the registry median; hover over a bar for the numbers. Sources and how the index is computed: methodology.
Providers and prices
$ per 1M tokens · from genai-prices| Provider | Gateway | Pydantic AI model string | Input | Cached input | Output | Blended |
|---|---|---|---|---|---|---|
| Groq | gateway/groq:moonshotai/kimi-k2-instruct | $1 | $0.5 | $3 | $1.5 | |
| Novita | BYOK | – | $0.57 | – | $2.3 | $1 |
| OpenRouter | BYOK | openrouter:moonshotai/kimi-k2 | $0.57 | – | $2.3 | $1 |
The cheapest provider is highlighted. Blended price assumes three input tokens for each output token.
Example code
# /// script # dependencies = ["pydantic-ai"] # /// import os from pydantic_ai import Agent os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...' agent = Agent('gateway/groq:moonshotai/kimi-k2-instruct', instructions='Be concise, reply with one sentence.') result = agent.run_sync('Where does "hello world" come from?') print(result.output)
# /// script # dependencies = ["pydantic-ai"] # /// import os from pydantic import BaseModel from pydantic_ai import Agent os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...' class CityLocation(BaseModel): city: str country: str agent = Agent('gateway/groq:moonshotai/kimi-k2-instruct', output_type=CityLocation) result = agent.run_sync('Where were the olympics held in 2012?') print(result.output) #> city='London' country='United Kingdom'
# /// script # dependencies = ["pydantic-ai"] # /// import os import random from pydantic_ai import Agent, RunContext os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...' agent = Agent( 'gateway/groq:moonshotai/kimi-k2-instruct', deps_type=str, instructions="You're a dice game, roll the die and see if it matches the user's guess.", ) @agent.tool_plain def roll_dice() -> str: """Roll a six-sided die and return the result.""" return str(random.randint(1, 6)) @agent.tool def get_player_name(ctx: RunContext[str]) -> str: """Get the player's name.""" return ctx.deps result = agent.run_sync('My guess is 4', deps='Anne') print(result.output)
# /// script # dependencies = ["pydantic-ai"] # /// import asyncio import os from pydantic_ai import Agent os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...' agent = Agent('gateway/groq:moonshotai/kimi-k2-instruct') async def main(): async with agent.run_stream('Explain prompt caching in three bullet points.') as response: async for text in response.stream_text(delta=True): print(text, end='', flush=True) asyncio.run(main())
export PYDANTIC_AI_GATEWAY_API_KEY='...' uvx pax --model 'gateway/groq:moonshotai/kimi-k2-instruct'
# npm install -g @earendil-works/pi-coding-agent export PYDANTIC_AI_GATEWAY_API_KEY='...' # pi has no built-in Gateway provider, so register one. # Merge this by hand if you already have a models.json. mkdir -p ~/.pi/agent cat > ~/.pi/agent/models.json <<'EOF' { "providers": { "pydantic-ai-gateway": { "baseUrl": "https://gateway.pydantic.dev/proxy/groq/v1", "api": "openai-completions", "apiKey": "$PYDANTIC_AI_GATEWAY_API_KEY", "models": [ { "id": "moonshotai/kimi-k2-instruct" } ] } } } EOF pi --provider pydantic-ai-gateway --model 'moonshotai/kimi-k2-instruct'
# npm install -g @openai/codex export PYDANTIC_AI_GATEWAY_API_KEY='...' codex --model 'moonshotai/kimi-k2-instruct' \ -c model_provider='gateway' \ -c model_providers.gateway.name='Pydantic AI Gateway' \ -c model_providers.gateway.base_url='https://gateway.pydantic.dev/proxy/groq/v1' \ -c model_providers.gateway.env_key='PYDANTIC_AI_GATEWAY_API_KEY'
// npm install ai @ai-sdk/groq import { createGroq } from '@ai-sdk/groq' import { generateText } from 'ai' process.env.PYDANTIC_AI_GATEWAY_API_KEY = '...' const groq = createGroq({ baseURL: 'https://gateway.pydantic.dev/proxy/groq', apiKey: process.env.PYDANTIC_AI_GATEWAY_API_KEY, }) const { text } = await generateText({ model: groq('moonshotai/kimi-k2-instruct'), system: 'Be concise, reply with one sentence.', prompt: 'Where does "hello world" come from?', }) console.log(text)
Ask Kimi K2 0711 a question with a Pydantic AI agent and print the answer. Run it with uv run hello.py.
Get validated, typed output from Kimi K2 0711 by giving the agent a Pydantic model. Run it with uv run structured_output.py.
Give Kimi K2 0711 two tools to call, one of which reads the agent's dependencies. Run it with uv run tools.py.
Stream Kimi K2 0711's reply to the terminal as it is generated. Run it with uv run streaming.py.
Chat with Kimi K2 0711 in your terminal using pax, the TUI for pydantic-ai-harness. Coming soon.
Use Kimi K2 0711 as the model behind the pi coding agent, with Pydantic AI Gateway registered as a custom provider in ~/.pi/agent/models.json.
Run OpenAI's Codex CLI on Kimi K2 0711 through Pydantic AI Gateway.
Call Kimi K2 0711 from TypeScript with the Vercel AI SDK, through Pydantic AI Gateway.
Compare
Score against blended price per 1M tokens (log scale). Kimi K2 0711 Step 5 Preview other models
About Kimi K2 0711
Description written by an LLM from the data on this pageOpen-weight text model from Moonshot AI with tool calling and a long context window. Its only benchmark result, on Terminal-Bench, sits well below the registry median.
Kimi K2 0711 is an open-weight text model from Moonshot AI, with a 131k context window and up to 98k tokens per response. It supports tool calling, which is the main reason an agent builder might consider it. It is offered by Groq, Novita and OpenRouter and is built into the Gateway.
Pricing is $1 per million input tokens and $3 per million output tokens, a blended $1.50 that sits just above the registry median. The knowledge cutoff is December 2024. The model has no reasoning mode and no structured output option.
The only benchmark result is Terminal-Bench, where it completes 27.8% of tasks, 27th of 35 and well below the median of 43.2%. With so little benchmark coverage, this single score is the main evidence on agentic performance, and it suggests weaker results than the median model on that task.
Strengths
- Open weights, with tool calling supported
- 131k context window and 98k maximum response length
- Available from Groq, Novita and OpenRouter, and built into the Gateway
- Blended price of $1.50 per million tokens, just above the registry median
Weaknesses
- Terminal-Bench 27.8%, 27th of 35, well below the 43.2% median
- No reasoning mode or structured output; accepts text input only
- No intelligence-per-dollar figure is available for ranking value
Best for
Tool-calling agents on text tasks where open weights and a mid-range price matter more than terminal task performance.