# GPT-5.1 Codex

> GPT-5.1 Codex is a version of GPT-5.1 optimized for agentic coding inside the Codex environment, with regular underlying model refreshes. It supports a 400,000-token input context with 128,000 output tokens, accepts text and image inputs, and exposes reasoning tokens, streaming, function calling, and structured outputs. Available exclusively through the Responses API.


**ID**: `openai/gpt-5.1-codex`  
**Creator**: OpenAI  
**Category**: text  
**Context**: 400K tokens  
**Pricing**: $1.25 / $10.00 per 1M · billed by your provider (BYOK)  
**Released**: 2025-11-13  
**Web page**: https://anyrouter.dev/model/openai/gpt-5.1-codex

**Input modalities**: text, image  
**Output modalities**: text  

**Tokenizer**: GPT

**Capabilities**: chat, coding, reasoning, streaming, function-calling, vision

## Usage

**Endpoint**: `POST https://anyrouter.dev/api/v1/chat/completions`

```bash
curl https://anyrouter.dev/api/v1/chat/completions \
  -H "Authorization: Bearer $ANYROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "openai/gpt-5.1-codex",
  "messages": [
    {
      "role": "user",
      "content": "Say hi in 3 words."
    }
  ]
}'
```

## Providers

| Provider | Input | Output |
| --- | --- | --- |
| openai-byok | $1.25/M (list) | $10.00/M (list) |
| opencode-zen-byok | $1.25/M (list) | $10.00/M (list) |
| cline-byok | $1.25/M (list) | $10.00/M (list) |
| vercel-byok | $1.25/M (list) | $10.00/M (list) |

BYOK routes are billed by your own provider key — AnyRouter charges $0. Rates marked (list) are the provider's published list price.

## Benchmarks

- **GPQA Diamond**: 0.9
- **HLE**: 0.2
- **τ²-Bench Telecom**: 0.8
- **SciCode**: 0.4
