{"slug":"kimi-k2.7-code","name":"Kimi K2.7 Code","family":"moonshot","family_name":"Moonshot AI","developer":"Moonshot AI","color":"#7c5cff","status":"active","released":"2026-06-12","snapshot_of":null,"open":true,"context":262144,"max_output":262144,"knowledge_cutoff":"2025-01","modalities":["text","image"],"output_modalities":["text"],"reasoning":true,"tools":true,"structured_output":true,"huggingface":"moonshotai/Kimi-K2.7-Code","speed":39,"latency":2.02,"short":"An open-weight model from Moonshot AI with a 256k context window, image input and tool calling. It sits mid-to-low on the registry's intelligence index and costs more than the median, with strong competition math results.","strengths":["Open weights, hosted by four providers","95.6% on OTIS Mock AIME, 40th of 95, above the 94.2% median","Accepts text and images, with tool calling and structured output","Intelligence per dollar ranks 61st of 194"],"weaknesses":["Intelligence index 56.2, 66th of 114, below the 59.5 median","Blended price $1.71 per million tokens, above the $1.01 median","54% on FrontierMath, 54th of 80, against a 64.6% median"],"best_for":"Tool-using agents on a moderate budget that need image input, structured output and competition-style math.","long":"Kimi K2.7 Code is an open-weight model from Moonshot AI, released in June 2026. It has a 256k context window, a 256k maximum response length, and a reasoning mode. It accepts text and images and supports tool calling and structured output. Its knowledge cutoff is January 2025, and four providers host it.\n\nOn the registry's benchmarks it lands in the middle to lower part of the table. Its intelligence index score of 56.2 sits below the median of 59.5. It does well on OTIS Mock AIME, where it scores 95.6% against a median of 94.2%. It trails the median on FrontierMath, SimpleQA Verified, SciCode and APEX-Agents, where it ranks 51st of 60.\n\nPrice is a real cost. The blended rate of $1.71 per million tokens is well above the median, although its intelligence per dollar ranks 61st of 194. The model is not built into the Pydantic AI Gateway, which is not a drawback in itself.","described":true,"gateway":false,"byok":true,"string":"moonshotai:kimi-k2.7-code","input":0.95,"output":4,"cache_read":0.19,"blended":1.7125,"efficiency":32.8,"bench":{"index":56.2,"gpqa":87.9,"aime":95.6,"frontiermath":54,"simpleqa":36.5,"scicode":47.8,"webdev":1472.7,"apex":37.6,"eci":151.2},"offers":[{"provider":"moonshotai","name":"Moonshot AI","model_id":"kimi-k2.7-code","api":["openai"],"input":0.95,"output":4,"cache_read":0.19,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":262144,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"moonshotai:kimi-k2.7-code","gateway_string":null},{"provider":"cloudflare","name":"Cloudflare Workers AI","model_id":"@cf/moonshotai/kimi-k2.7-code","api":["openai"],"input":0.95,"output":4,"cache_read":0.19,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":null,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":null,"gateway_string":null},{"provider":"novita","name":"Novita","model_id":"moonshotai/kimi-k2.7-code","api":["openai"],"input":0.95,"output":4,"cache_read":0.19,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":262144,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":null,"gateway_string":null},{"provider":"openrouter","name":"OpenRouter","model_id":"moonshotai/kimi-k2.7-code","api":["openai"],"input":0.95,"output":4,"cache_read":0.19,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":262144,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"openrouter:moonshotai/kimi-k2.7-code","gateway_string":null}],"ranks":{"intelligence":63,"popularity":76,"efficiency":61,"speed":155,"price":117},"top_score":0.6431,"about":["An open-weight model from Moonshot AI with a 256k context window, image input and tool calling. It sits mid-to-low on the registry's intelligence index and costs more than the median, with strong competition math results.","Kimi K2.7 Code is an open-weight model from Moonshot AI, released in June 2026. It has a 256k context window, a 256k maximum response length, and a reasoning mode. It accepts text and images and supports tool calling and structured output. Its knowledge cutoff is January 2025, and four providers host it.","On the registry's benchmarks it lands in the middle to lower part of the table. Its intelligence index score of 56.2 sits below the median of 59.5. It does well on OTIS Mock AIME, where it scores 95.6% against a median of 94.2%. It trails the median on FrontierMath, SimpleQA Verified, SciCode and APEX-Agents, where it ranks 51st of 60.","Price is a real cost. The blended rate of $1.71 per million tokens is well above the median, although its intelligence per dollar ranks 61st of 194. The model is not built into the Pydantic AI Gateway, which is not a drawback in itself."],"examples":[{"file":"hello.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\n\nfrom pydantic_ai import Agent\n\nos.environ['MOONSHOTAI_API_KEY'] = '...'\n\nagent = Agent('moonshotai:kimi-k2.7-code', 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['MOONSHOTAI_API_KEY'] = '...'\n\n\nclass CityLocation(BaseModel):\n    city: str\n    country: str\n\n\nagent = Agent('moonshotai:kimi-k2.7-code', 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['MOONSHOTAI_API_KEY'] = '...'\n\nagent = Agent(\n    'moonshotai:kimi-k2.7-code',\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['MOONSHOTAI_API_KEY'] = '...'\n\nagent = Agent('moonshotai:kimi-k2.7-code')\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 MOONSHOTAI_API_KEY='...'\n\nuvx pax --model 'moonshotai:kimi-k2.7-code'","soon":true},{"file":"pi.sh","lang":"sh","code":"# npm install -g @earendil-works/pi-coding-agent\nexport MOONSHOTAI_API_KEY='...'\n\npi --model 'moonshotai/kimi-k2.7-code'","soon":false},{"file":"codex.sh","lang":"sh","code":"# npm install -g @openai/codex\nexport MOONSHOTAI_API_KEY='...'\n\ncodex --model 'kimi-k2.7-code' \\\n  -c model_provider='moonshotai' \\\n  -c model_providers.moonshotai.name='Moonshot AI' \\\n  -c model_providers.moonshotai.base_url='https://api.moonshotai.example/v1' \\\n  -c model_providers.moonshotai.env_key='MOONSHOTAI_API_KEY'","soon":false},{"file":"ai_sdk.ts","lang":"ts","code":"// npm install ai @ai-sdk/openai-compatible\nimport { createOpenAICompatible } from '@ai-sdk/openai-compatible'\nimport { generateText } from 'ai'\n\nprocess.env.MOONSHOTAI_API_KEY = '...'\n\nconst moonshotai = createOpenAICompatible({\n  name: 'moonshotai',\n  baseURL: 'https://api.moonshotai.example/v1',\n  apiKey: process.env.MOONSHOTAI_API_KEY,\n})\n\nconst { text } = await generateText({\n  model: moonshotai('kimi-k2.7-code'),\n  system: 'Be concise, reply with one sentence.',\n  prompt: 'Where does \"hello world\" come from?',\n})\nconsole.log(text)","soon":false}],"benchmarks":[{"id":"index","name":"Intelligence index","unit":"","desc":"Our composite of the benchmarks below, 0-100","category":"reference","floor":0,"ceiling":100,"url":"/methodology/","credit":"Pydantic, from the sources credited below"},{"id":"gpqa","name":"GPQA Diamond","unit":"%","desc":"Graduate-level science questions, multiple choice","category":"reasoning","floor":25,"ceiling":97,"url":"https://epoch.ai/benchmarks/gpqa-diamond","credit":"Epoch AI (CC BY 4.0)"},{"id":"aime","name":"OTIS Mock AIME","unit":"%","desc":"Competition mathematics problems with exact answers","category":"reasoning","floor":0,"ceiling":100,"url":"https://epoch.ai/benchmarks/otis-mock-aime-2024-2025","credit":"Epoch AI (CC BY 4.0)"},{"id":"frontiermath","name":"FrontierMath","unit":"%","desc":"Original research-level mathematics problems, tiers 1 to 3","category":"reasoning","floor":0,"ceiling":95,"url":"https://epoch.ai/frontiermath","credit":"Epoch AI (CC BY 4.0)"},{"id":"simpleqa","name":"SimpleQA Verified","unit":"%","desc":"Short factual questions answered from memory, without search","category":"reasoning","floor":0,"ceiling":100,"url":"https://epoch.ai/benchmarks/simpleqa-verified","credit":"Epoch AI (CC BY 4.0)"},{"id":"scicode","name":"SciCode","unit":"%","desc":"Scientific programming problems written by researchers","category":"coding","floor":0,"ceiling":100,"url":"https://scicode-bench.github.io/","credit":"SciCode, via Epoch AI (CC BY 4.0)"},{"id":"webdev","name":"WebDev Arena","unit":"","desc":"Rating from human votes on web apps the models built","category":"coding","floor":1000,"ceiling":1900,"url":"https://web.lmarena.ai/leaderboard","credit":"LMArena, via Epoch AI (CC BY 4.0)"},{"id":"apex","name":"APEX-Agents","unit":"%","desc":"Long professional tasks (banking, consulting, law) passed on the first attempt","category":"agents","floor":0,"ceiling":100,"url":"https://epoch.ai/benchmarks","credit":"Mercor, via Epoch AI (CC BY 4.0)"},{"id":"eci","name":"Epoch Capabilities Index","unit":"","desc":"Epoch AI's own composite across about 40 benchmarks; shown for comparison, not part of our index","category":"reference","floor":80,"ceiling":180,"url":"https://epoch.ai/benchmarks/eci","credit":"Epoch AI (CC BY 4.0)"}],"generated":"2026-11-25","gaps":{"speed":3,"index":80,"description":0}}