{"slug":"kimi-k2","name":"Kimi K2 0711","family":"moonshot","family_name":"Moonshot AI","developer":"Moonshot AI","color":"#7c5cff","status":"active","released":"2025-07-11","snapshot_of":null,"open":true,"context":131072,"max_output":98304,"knowledge_cutoff":"2024-12","modalities":["text"],"output_modalities":["text"],"reasoning":false,"tools":true,"structured_output":false,"huggingface":"moonshotai/Kimi-K2-Instruct","speed":32,"latency":0.79,"short":"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.","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.","long":"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.\n\nPricing 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.\n\nThe 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.","described":true,"gateway":true,"byok":true,"string":"gateway/groq:moonshotai/kimi-k2-instruct","input":1,"output":3,"cache_read":0.5,"blended":1.5,"efficiency":null,"bench":{"terminal":27.8},"offers":[{"provider":"groq","name":"Groq","model_id":"moonshotai/kimi-k2-instruct","api":["openai"],"input":1,"output":3,"cache_read":0.5,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":131072,"deprecated":false,"gateway":true,"gateway_route":"groq","byok":true,"string":"groq:moonshotai/kimi-k2-instruct","gateway_string":"gateway/groq:moonshotai/kimi-k2-instruct"},{"provider":"novita","name":"Novita","model_id":"moonshotai/kimi-k2-instruct","api":["openai"],"input":0.57,"output":2.3,"cache_read":null,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":131072,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":null,"gateway_string":null},{"provider":"openrouter","name":"OpenRouter","model_id":"moonshotai/kimi-k2","api":["openai"],"input":0.57,"output":2.3,"cache_read":null,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":131072,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"openrouter:moonshotai/kimi-k2","gateway_string":null}],"ranks":{"intelligence":null,"popularity":101,"efficiency":null,"speed":165,"price":108},"top_score":0.2119,"about":["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.","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."],"examples":[{"file":"hello.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\n\nfrom pydantic_ai import Agent\n\nos.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'\n\nagent = Agent('gateway/groq:moonshotai/kimi-k2-instruct', instructions='Be concise, reply with one sentence.')\n\nresult = agent.run_sync('Where does \"hello world\" come from?')\nprint(result.output)","soon":false},{"file":"structured_output.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\n\nfrom pydantic import BaseModel\nfrom pydantic_ai import Agent\n\nos.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'\n\n\nclass CityLocation(BaseModel):\n    city: str\n    country: str\n\n\nagent = Agent('gateway/groq:moonshotai/kimi-k2-instruct', output_type=CityLocation)\n\nresult = agent.run_sync('Where were the olympics held in 2012?')\nprint(result.output)\n#> city='London' country='United Kingdom'","soon":false},{"file":"tools.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\nimport random\n\nfrom pydantic_ai import Agent, RunContext\n\nos.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'\n\nagent = Agent(\n    'gateway/groq:moonshotai/kimi-k2-instruct',\n    deps_type=str,\n    instructions=\"You're a dice game, roll the die and see if it matches the user's guess.\",\n)\n\n\n@agent.tool_plain\ndef roll_dice() -> str:\n    \"\"\"Roll a six-sided die and return the result.\"\"\"\n    return str(random.randint(1, 6))\n\n\n@agent.tool\ndef get_player_name(ctx: RunContext[str]) -> str:\n    \"\"\"Get the player's name.\"\"\"\n    return ctx.deps\n\n\nresult = agent.run_sync('My guess is 4', deps='Anne')\nprint(result.output)","soon":false},{"file":"streaming.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport asyncio\nimport os\n\nfrom pydantic_ai import Agent\n\nos.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'\n\nagent = Agent('gateway/groq:moonshotai/kimi-k2-instruct')\n\n\nasync def main():\n    async with agent.run_stream('Explain prompt caching in three bullet points.') as response:\n        async for text in response.stream_text(delta=True):\n            print(text, end='', flush=True)\n\n\nasyncio.run(main())","soon":false},{"file":"pax.sh","lang":"sh","code":"export PYDANTIC_AI_GATEWAY_API_KEY='...'\n\nuvx pax --model 'gateway/groq:moonshotai/kimi-k2-instruct'","soon":true},{"file":"pi.sh","lang":"sh","code":"# npm install -g @earendil-works/pi-coding-agent\nexport PYDANTIC_AI_GATEWAY_API_KEY='...'\n\n# pi has no built-in Gateway provider, so register one.\n# Merge this by hand if you already have a models.json.\nmkdir -p ~/.pi/agent\ncat > ~/.pi/agent/models.json <<'EOF'\n{\n  \"providers\": {\n    \"pydantic-ai-gateway\": {\n      \"baseUrl\": \"https://gateway.pydantic.dev/proxy/groq/v1\",\n      \"api\": \"openai-completions\",\n      \"apiKey\": \"$PYDANTIC_AI_GATEWAY_API_KEY\",\n      \"models\": [\n        {\n          \"id\": \"moonshotai/kimi-k2-instruct\"\n        }\n      ]\n    }\n  }\n}\nEOF\n\npi --provider pydantic-ai-gateway --model 'moonshotai/kimi-k2-instruct'","soon":false},{"file":"codex.sh","lang":"sh","code":"# npm install -g @openai/codex\nexport PYDANTIC_AI_GATEWAY_API_KEY='...'\n\ncodex --model 'moonshotai/kimi-k2-instruct' \\\n  -c model_provider='gateway' \\\n  -c model_providers.gateway.name='Pydantic AI Gateway' \\\n  -c model_providers.gateway.base_url='https://gateway.pydantic.dev/proxy/groq/v1' \\\n  -c model_providers.gateway.env_key='PYDANTIC_AI_GATEWAY_API_KEY'","soon":false},{"file":"ai_sdk.ts","lang":"ts","code":"// npm install ai @ai-sdk/groq\nimport { createGroq } from '@ai-sdk/groq'\nimport { generateText } from 'ai'\n\nprocess.env.PYDANTIC_AI_GATEWAY_API_KEY = '...'\n\nconst groq = createGroq({\n  baseURL: 'https://gateway.pydantic.dev/proxy/groq',\n  apiKey: process.env.PYDANTIC_AI_GATEWAY_API_KEY,\n})\n\nconst { text } = await generateText({\n  model: groq('moonshotai/kimi-k2-instruct'),\n  system: 'Be concise, reply with one sentence.',\n  prompt: 'Where does \"hello world\" come from?',\n})\nconsole.log(text)","soon":false}],"benchmarks":[{"id":"terminal","name":"Terminal-Bench","unit":"%","desc":"Tasks completed in a terminal; the best result of any agent using the model","category":"coding","floor":0,"ceiling":100,"url":"https://www.tbench.ai/leaderboard/terminal-bench/2.0","credit":"Terminal-Bench, via Epoch AI (CC BY 4.0)"}],"generated":"2026-11-25","gaps":{"speed":3,"index":80,"description":0}}