# gpt-oss-120b

> An open-weights 120B-parameter-class model from OpenAI, released August 2025, priced very low for its size. Its benchmark scores mostly sit well below the registry median.

Use it with Pydantic AI as `gateway/groq:openai/gpt-oss-120b`.

## Spec sheet

- **Family:** OpenAI
- **Released:** 5 Aug 2025
- **Weights:** open
- **Context window:** 131,072 tokens
- **Largest response:** 117,964 tokens
- **Accepts:** text
- **Tool calling:** yes
- **Knowledge cutoff:** 2024-06
- **Intelligence index:** 34.3 (rank 109)
- **Price:** $0.15 input, $0.6 output, $0.26 blended per 1M tokens
- **Index points per $:** 130.7 (rank 19)
- **Speed:** 121.5 tokens/sec (rank 27)
- **Popularity:** rank 40 of 194 by usage
- **Pydantic AI Gateway:** built in

## Benchmarks

| Benchmark | Score | Rank among models tested | What it measures | Source |
| --- | --- | --- | --- | --- |
| Intelligence index | 34.3 | 112 | Our composite of the benchmarks below, 0-100 | Pydantic, from the sources credited below |
| GPQA Diamond | 75.8% | 85 | Graduate-level science questions, multiple choice | Epoch AI (CC BY 4.0) |
| OTIS Mock AIME | 88.9% | 59 | Competition mathematics problems with exact answers | Epoch AI (CC BY 4.0) |
| Terminal-Bench | 18.7% | 32 | Tasks completed in a terminal; the best result of any agent using the model | Terminal-Bench, via Epoch AI (CC BY 4.0) |
| SciCode | 36% | 91 | Scientific programming problems written by researchers | SciCode, via Epoch AI (CC BY 4.0) |
| APEX-Agents | 4.4% | 60 | Long professional tasks (banking, consulting, law) passed on the first attempt | Mercor, via Epoch AI (CC BY 4.0) |
| LMArena text | 1365.4 | 106 | Rating from blind human votes between pairs of chat responses | LMArena (CC BY 4.0) |
| Epoch Capabilities Index | 140.2 | 93 | 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 |
| --- | --- | --- | --- | --- | --- |
| Groq | built in | `gateway/groq:openai/gpt-oss-120b` | $0.15 | $0.075 | $0.6 |
| Novita | BYOK | – | $0.05 | – | $0.25 |
| OVHcloud | BYOK | `ovhcloud:gpt-oss-120b` | $0.09 | – | $0.47 |
| Baseten | BYOK | – | $0.1 | – | $0.5 |
| OpenRouter | BYOK | `openrouter:openai/gpt-oss-120b` | $0.1 | – | $0.5 |
| Fireworks | BYOK | `fireworks:gpt-oss-120b` | $0.15 | $0.015 | $0.6 |
| Together AI | BYOK | `together:openai/gpt-oss-120b` | $0.15 | – | $0.6 |
| Cerebras | BYOK | `cerebras:gpt-oss-120b` | $0.35 | – | $0.75 |
| Cloudflare Workers AI | BYOK | – | $0.35 | – | $0.75 |

## Example code

### hello.py

Ask gpt-oss-120b 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/groq:openai/gpt-oss-120b', 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 gpt-oss-120b 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/groq:openai/gpt-oss-120b', 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 gpt-oss-120b 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/groq:openai/gpt-oss-120b',
    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 gpt-oss-120b'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/groq:openai/gpt-oss-120b')


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

Chat with gpt-oss-120b in your terminal using pax, the TUI for pydantic-ai-harness. Coming soon.

```sh
export PYDANTIC_AI_GATEWAY_API_KEY='...'

uvx pax --model 'gateway/groq:openai/gpt-oss-120b'
```

### pi.sh

Use gpt-oss-120b as the model behind the pi coding agent, with Pydantic AI Gateway registered as a custom provider in ~/.pi/agent/models.json.

```sh
# 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": "openai/gpt-oss-120b"
        }
      ]
    }
  }
}
EOF

pi --provider pydantic-ai-gateway --model 'openai/gpt-oss-120b'
```

### codex.sh

Run OpenAI's Codex CLI on gpt-oss-120b through Pydantic AI Gateway.

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

codex --model 'openai/gpt-oss-120b' \
  -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'
```

### ai_sdk.ts

Call gpt-oss-120b from TypeScript with the Vercel AI SDK, through Pydantic AI Gateway.

```ts
// 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('openai/gpt-oss-120b'),
  system: 'Be concise, reply with one sentence.',
  prompt: 'Where does "hello world" come from?',
})
console.log(text)
```

## About gpt-oss-120b

gpt-oss-120b is an open-weights text model from OpenAI, released in August 2025, with a 131k token context window and reasoning mode. Its main appeal is price. At $0.15 per million input tokens and $0.60 per million output tokens, it is among the cheaper options in the registry, and its intelligence points per dollar rank 19th of 194. It is available from nine providers, and it is built into the Pydantic AI Gateway.

The capability results are weak relative to the registry. Its intelligence index of 34.3 ranks 112th of 114, and it scores below the median on every benchmark listed. GPQA Diamond is 75.8% against a median of 89.8%, and it places 85th of 94. On agentic tests it is weakest: APEX-Agents is 4.4%, last of 60, and Terminal-Bench is 18.7%, 32nd of 35. LMArena places it 106th of 114.

It suits tasks where cost matters more than peak quality and the work is fairly routine. Anything requiring careful multi-step agent behaviour should be tested before use.

**Strengths**

- Input costs $0.15 per million tokens, well below the $1.01 registry median blend
- Blended price of $0.26 per million tokens, 38th of 194 for price
- Efficiency rank 19 of 194 on intelligence points per dollar
- Supports tool calling, reasoning mode and structured output

**Weaknesses**

- Intelligence index 34.3, 112th of 114 against a median of 59.5
- APEX-Agents 4.4%, last of 60 against a median of 54.3%
- Terminal-Bench 18.7%, 32nd of 35 against a median of 43.2%

**Best for:** Cost-sensitive, high-volume tasks with simple reasoning, structured output or tool calls, where a weaker model is acceptable.

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); the index and its sources are described at https://models.pydantic.dev/methodology.md. Data built 2026-11-25. Compare with other models: https://models.pydantic.dev/models.md
