---
title: "Kimi K3.1 Pro"
description: "An open-weights multimodal model from Moonshot AI with a very large context window. It ranks near the top on competition mathematics but costs well above the registry median."
canonical: https://pydantic.dev/models/list/kimi-k3.1-pro/
---

# Kimi K3.1 Pro

> An open-weights multimodal model from Moonshot AI with a very large context window. It ranks near the top on competition mathematics but costs well above the registry median.
>
> Markdown copy of https://pydantic.dev/models/list/kimi-k3.1-pro/. Index for agents: https://pydantic.dev/models/llms.txt

**Agents: use the API for model information.** It answers a question in one request, where the pages need several.

- Choose a model for an agent: `POST https://pydantic.dev/models/api/select` with a JSON body such as `{"description": "what the agent does"}`. It returns up to five ranked models with reasons. Format: https://pydantic.dev/models/select.md
- Search models by name: `GET https://pydantic.dev/models/api/search?query=<text>`
- List, filter and sort models: `GET https://pydantic.dev/models/api/models`, for example `?weights=open&max_price=2&sort=efficiency`
- One model in full: `GET https://pydantic.dev/models/api/models/<slug>`
- Any other question about the models: `GET https://pydantic.dev/models/api/ask?query=<question>`

Add `intent=<intent>&stack=<stack>&harness=<harness>` to the query string of all but the single model. An `OPTIONS` request to any endpoint returns its schema. The same five are tools of the MCP server at `https://pydantic.dev/models/mcp`. More: https://pydantic.dev/models/usage.md

Use it with Pydantic AI as `gateway/doubleword:moonshotai/Kimi-K3.1-Pro`.

## Spec sheet

- **Family:** Moonshot AI
- **Released:** 23 Oct 2026
- **Weights:** open
- **Context window:** 1,048,576 tokens
- **Largest response:** 1,048,576 tokens
- **Accepts:** text, image, video
- **Tool calling:** yes
- **Knowledge cutoff:** unknown
- **Intelligence index:** 69.5 (rank 17)
- **Scores updated:** 2026-11-30
- **Price:** $2 input, $10 output, $4 blended per 1M tokens
- **Index points per $:** 17.4 (rank 71)
- **Speed:** 48 tokens/sec (rank 127)
- **Popularity:** rank 6 of 194 by usage
- **Pydantic AI Gateway:** built in

## Benchmarks

### Pydantic AI benchmarks

Our own benchmarks, each about 10 tasks run once with tool calling and once in code mode (https://pydantic.dev/models/codemode.md). Not part of the intelligence index. Cost is the mean cost of one task. For the combined score, code mode is compared over the four benchmarks run in both modes.

| Benchmark                                                                                      | Tool calling | Code mode | Change | Cost per task | Cost per task, code mode | Rank     | Runs                                                                |
| ---------------------------------------------------------------------------------------------- | ------------ | --------- | ------ | ------------- | ------------------------ | -------- | ------------------------------------------------------------------- |
| [Pydantic AI Combined](https://pydantic.dev/models/benchmarks/pydantic_ai.md)                  | 76.2%        | 71.2%     | −0.6   | $0.35         | $0.39                    | 12 of 44 | https://pydantic.dev/models/list/kimi-k3.1-pro/pydantic_ai.md       |
| [Pydantic AI - Billing ops](https://pydantic.dev/models/benchmarks/billing_ops.md)             | 90%          | 80%       | −10    | $0.28         | $0.074                   | 4 of 44  | https://pydantic.dev/models/list/kimi-k3.1-pro/billing_ops.md       |
| [Pydantic AI - Customer support](https://pydantic.dev/models/benchmarks/customer_support.md)   | 50%          | 40%       | −10    | $0.15         | $0.18                    | 12 of 44 | https://pydantic.dev/models/list/kimi-k3.1-pro/customer_support.md  |
| [Pydantic AI - SQL data analysis](https://pydantic.dev/models/benchmarks/sql_data_analysis.md) | 80%          | 90%       | +10    | $0.74         | $0.57                    | 16 of 44 | https://pydantic.dev/models/list/kimi-k3.1-pro/sql_data_analysis.md |
| [Pydantic AI - Research & deck](https://pydantic.dev/models/benchmarks/research_deck.md)       | 67.4%        | 74.8%     | +7.4   | $0.84         | $0.73                    | 31 of 44 | https://pydantic.dev/models/list/kimi-k3.1-pro/research_deck.md     |
| [Pydantic AI - Structured output](https://pydantic.dev/models/benchmarks/structured_output.md) | 100%         | –         | –      | $0.067        | –                        | 1 of 44  | https://pydantic.dev/models/list/kimi-k3.1-pro/structured_output.md |
| [Pydantic AI - LLM Judge](https://pydantic.dev/models/benchmarks/llm_judge.md)                 | 70%          | –         | –      | $0.022        | –                        | 18 of 44 | https://pydantic.dev/models/list/kimi-k3.1-pro/llm_judge.md         |
| [Pydantic AI - Cyber Willing](https://pydantic.dev/models/benchmarks/cyber_willing.md)         | 75%          | –         | –      | $0.091        | –                        | 20 of 32 | https://pydantic.dev/models/list/kimi-k3.1-pro/cyber_willing.md     |

### Other benchmarks


| Benchmark                | Score  | Rank among models tested | What it measures                                                                                 | Source                                    |
| ------------------------ | ------ | ------------------------ | ------------------------------------------------------------------------------------------------ | ----------------------------------------- |
| Intelligence index       | 69.5   | 17                       | Our composite of the benchmarks below, 0-100                                                     | Pydantic, from the sources credited below |
| GPQA Diamond             | 94.2%  | 15                       | Graduate-level science questions, multiple choice                                                | Epoch AI (CC BY 4.0)                      |
| OTIS Mock AIME           | 100%   | 1                        | Competition mathematics problems with exact answers                                              | Epoch AI (CC BY 4.0)                      |
| FrontierMath             | 78.2%  | 25                       | Original research-level mathematics problems, tiers 1 to 3                                       | Epoch AI (CC BY 4.0)                      |
| SimpleQA Verified        | 62.2%  | 20                       | Short factual questions answered from memory, without search                                     | Epoch AI (CC BY 4.0)                      |
| SciCode                  | 60.8%  | 9                        | Scientific programming problems written by researchers                                           | SciCode, via Epoch AI (CC BY 4.0)         |
| APEX-Agents              | 65.5%  | 15                       | Long professional tasks (banking, consulting, law) passed on the first attempt                   | Mercor, via Epoch AI (CC BY 4.0)          |
| LMArena text             | 1458.9 | 34                       | Rating from blind human votes between pairs of chat responses                                    | LMArena (CC BY 4.0)                       |
| FrontierMath Tier 4      | 65.9%  | 20                       | Research-level mathematics problems, the hardest tier, with checkable answers                    | Epoch AI (CC BY 4.0)                      |
| Chess Puzzles            | 45%    | 31                       | Find the single best move in a chess position                                                    | Epoch AI (CC BY 4.0)                      |
| Mystery Game Puzzles     | 42%    | 20                       | Best-move puzzles in an undisclosed well-known game                                              | Epoch AI (CC BY 4.0)                      |
| Furniture Assembly       | 55.8%  | 16                       | Spot assembly mistakes in photos of flat-pack furniture builds                                   | Epoch AI (CC BY 4.0)                      |
| ALE-Bench                | 1932.8 | 18                       | Hard optimisation contest problems, as a rating against human contestants                        | Sakana AI, via Epoch AI (CC BY 4.0)       |
| Browser Use Bench        | 76.7   | 5                        | Tasks on live websites, scored 0-100 against a weighted rubric by an LLM judge                   | Browser Use, with permission              |
| Epoch Capabilities Index | 161.1  | 20                       | Epoch AI's own composite across about 40 benchmarks; shown for comparison, not part of our index | Epoch AI (CC BY 4.0)                      |

## Providers and prices

US dollars per million tokens.

| Provider    | Gateway  | Pydantic AI string                            | Input | Cached input | Output |
| ----------- | -------- | --------------------------------------------- | ----- | ------------ | ------ |
| Moonshot AI | BYOK     | `moonshotai:kimi-k3.1-pro`                    | $2    | $0.2         | $10    |
| Doubleword  | built in | `gateway/doubleword:moonshotai/Kimi-K3.1-Pro` | $2    | $0.2         | $10    |
| Novita      | BYOK     | –                                             | $2    | $0.2         | $10    |
| OpenRouter  | BYOK     | `openrouter:moonshotai/kimi-k3.1-pro`         | $2    | $0.2         | $10    |
| Together AI | BYOK     | `together:moonshotai/Kimi-K3.1-Pro`           | $2    | $0.2         | $10    |

## Use Kimi K3.1 Pro with Pydantic AI

### hello.py

Ask Kimi K3.1 Pro a question with a Pydantic AI agent and print the answer. Run it with uv run hello.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os

from pydantic_ai import Agent

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'

agent = Agent('gateway/doubleword:moonshotai/Kimi-K3.1-Pro', instructions='Be concise, reply with one sentence.')

result = agent.run_sync('Where does "hello world" come from?')
print(result.output)
```

### structured_output.py

Get validated, typed output from Kimi K3.1 Pro by giving the agent a Pydantic model. Run it with uv run structured_output.py.

```python
# /// 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/doubleword:moonshotai/Kimi-K3.1-Pro', output_type=CityLocation)

result = agent.run_sync('Where were the olympics held in 2012?')
print(result.output)
#> city='London' country='United Kingdom'
```

### tools.py

Give Kimi K3.1 Pro two tools to call, one of which reads the agent's dependencies. Run it with uv run tools.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import os
import random

from pydantic_ai import Agent, RunContext

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'

agent = Agent(
    'gateway/doubleword:moonshotai/Kimi-K3.1-Pro',
    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)
```

### streaming.py

Stream Kimi K3.1 Pro's reply to the terminal as it is generated. Run it with uv run streaming.py.

```python
# /// script
# dependencies = ["pydantic-ai"]
# ///
import asyncio
import os

from pydantic_ai import Agent

os.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'

agent = Agent('gateway/doubleword:moonshotai/Kimi-K3.1-Pro')


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())
```

### pax.sh

Code with Kimi K3.1 Pro in your terminal using Pax, the Pydantic AI coding agent. On macOS, open a new terminal after installing, so pax isn't the system's archiver.

```sh
# uv tool install pydantic-ai-pax
export PYDANTIC_AI_GATEWAY_API_KEY='...'

pax -m 'gateway/doubleword:moonshotai/Kimi-K3.1-Pro'
```

### codex.sh

Run OpenAI's Codex CLI on Kimi K3.1 Pro through Pydantic AI Gateway.

```sh
# npm install -g @openai/codex
export PYDANTIC_AI_GATEWAY_API_KEY='...'

codex --model 'moonshotai/Kimi-K3.1-Pro' \
  -c model_provider='gateway' \
  -c model_providers.gateway.name='Pydantic AI Gateway' \
  -c model_providers.gateway.base_url='https://gateway.pydantic.dev/proxy/doubleword/v1' \
  -c model_providers.gateway.env_key='PYDANTIC_AI_GATEWAY_API_KEY'
```

### ai_sdk.ts

Call Kimi K3.1 Pro from TypeScript with the Vercel AI SDK, through Pydantic AI Gateway.

```ts
// npm install ai @ai-sdk/openai-compatible
import { createOpenAICompatible } from '@ai-sdk/openai-compatible'
import { generateText } from 'ai'

process.env.PYDANTIC_AI_GATEWAY_API_KEY = '...'

const doubleword = createOpenAICompatible({
  baseURL: 'https://gateway.pydantic.dev/proxy/doubleword',
  apiKey: process.env.PYDANTIC_AI_GATEWAY_API_KEY,
})

const { text } = await generateText({
  model: doubleword('moonshotai/Kimi-K3.1-Pro'),
  system: 'Be concise, reply with one sentence.',
  prompt: 'Where does "hello world" come from?',
})
console.log(text)
```

## About Kimi K3.1 Pro

Kimi K3.1 Pro costs $2 per million input tokens and $10 per million output tokens, has a 1M token context window and scores 69.5 on our intelligence index, #17 of 101.

Kimi K3.1 Pro is an open-weights model from Moonshot AI, released in October 2026. It accepts text, image and video, supports tool calling, reasoning and structured output, and has a very large context window. Several providers serve it.

Its strongest results are in mathematics and science: it is among the leaders on competition mathematics and graduate-level science questions, and its intelligence index is well above the median. Agentic and chat results are mid-table.

Cost is the main drawback. Its blended price per token is several times the registry median, which puts it among the more expensive models.

**Strengths**

- Among the best on competition mathematics
- Intelligence index well above the median
- Strong on graduate-level science questions
- Strong on scientific programming

**Weaknesses**

- Blended price several times the registry median
- Among the more expensive models
- Chat preference ratings only slightly above the median

**Best for:** Math-heavy reasoning and long-document agent work where per-token cost is not the main concern.

## How it did on the Pydantic AI benchmarks

Written by an LLM from reviews of every run.

#### Overall
Across five benchmarks the model passed most cases: 90%/80% (tools/code mode) on Billing ops, 67%/75% on Research & deck, 100% on Structured output (tools only), 70% on LLM Judge (tools only) and 80%/90% on SQL data analysis. It reads source material thoroughly and follows domain rules closely. Its failures come from incomplete checks it has already noticed, from guessing what the grader wants, and from repeated avoidable errors in the code-mode sandbox.

#### Strengths
- On Structured output it applied sign rules, £000 scaling and group-versus-parent columns correctly in all 10 cases, nine of them in a single request.
- On Billing ops it passed all 4 changes to the books (oldest-first payment allocation, void and reissue in the right order) and all 4 margin runs, including half-up rounding and non-taxable clients.
- On SQL data analysis it implemented repeats, service-day bitmasks, interpolation and walking margins in every run, and usually iterated until no state improved rather than stopping at the first feasible journey.
- On Research & deck both runs read the whole data room and avoided every planted trap (cancelled-order revenue, delivered vs in-service bikes, the prototype photo).
- On LLM Judge it caught concrete factual conflicts such as an integration claim against an empty integrations list, and matched the panel on key points in 6 of 7 support cases.

#### Weaknesses
- On Billing ops all three failures were the multi-check wrong-invoices audit, and in each one its notes named the missing error types before it answered anyway.
- On Research & deck it asked the founder too few, poorly targeted questions, so each run met only half the brief and failed `kestrel-cargo` in both modes.
- On LLM Judge it was lenient on `no_contradiction`/`no_false_promise` and inconsistent in strictness, and in at least five cases its reasoning tried to infer the expected labels.
- On Structured output it used null and 0 inconsistently on unscored fields, and once summed debtors because the checker 'likely expects' it, against the handbook.
- On SQL data analysis it ran out of the 80-request limit on the tools `tour` run, and it repeated the same errors across runs: the DuckDB `at` keyword and unsupported sandbox modules (`heapq`, `time`).

#### Tool calling compared with code mode
- On Billing ops code mode was much cheaper on large data ($0.07 vs $1.19 for duplicate lines), but on the small wrong-invoices case tool calling passed where the code-mode script tested only what it was written to test.
- On Billing ops code mode lost requests to seven failed scripts across five runs, from missing imports and `next(generator)`.
- On SQL data analysis code mode cost $5.73 vs $7.41 and was faster when the search ran in Python (`arrive_by` 18 vs 35 requests), but slower when it only wrapped single SQL calls (`one_vehicle` 31 vs 19).
- On Research & deck code mode cost $0.73 vs $0.84 and interpolated computed figures into the HTML, while tool calling had to re-send the whole ~35k-character deck for a one-rule CSS fix.
- Structured output and LLM Judge were run in tool-calling mode only, so there is no comparison for them.

Prices come from [genai-prices](https://github.com/pydantic/genai-prices), in US dollars per million tokens. Benchmark scores come from Epoch AI and LMArena (CC BY 4.0), Browser Use, and our own Pydantic AI benchmarks (CC BY 4.0); the index and its sources are described at https://pydantic.dev/models/methodology.md. Data built 2026-11-30. This model from the API: `https://pydantic.dev/models/api/models/kimi-k3.1-pro`. Compare it with others: `https://pydantic.dev/models/api/models?slug=kimi-k3.1-pro,<other slug>`
