# gpt-5.1-codex — API, Pricing & Context Window | Vivgrid

> Source: https://vivgrid.com/docs/models/gpt-5.1-codex

gpt-5.1-codex on Vivgrid: a Codex-tuned coding model on the Responses API with a 400K context window and three-region geo-distributed acceleration.

`gpt-5.1-codex` is OpenAI's Codex-tuned 5.1 coding model, designed for agentic software engineering through the **Responses API**. It is a well-rounded, cost-effective option for everyday coding agents.

Vivgrid accelerates `gpt-5.1-codex` across **AMER, EMEA, and APAC** — the broadest reach in the Codex line — with a **400K-token context window** for project-scale sessions.

## Specifications

| Field | Value |
| --- | --- |
| Provider | OpenAI |
| Model ID | `gpt-5.1-codex` |
| Best for | Coding |
| Available on | Vibe coding |
| Context window | 400,000 tokens |
| Max output | 128,000 tokens |
| Modalities | Text, Image, Audio |
| Tool / function calling | Yes |
| Knowledge cutoff | 2024-09 |
| Acceleration | Geo-distributed — AMER, EMEA, APAC |

## Pricing

Pricing in USD per 1M tokens.

| Input | Cached input | Output |
| --- | --- | --- |
| $1.25 | $0.125 | $10.00 |

### What one request costs

The rates above applied to a 20K-token prompt with a 2K-token reply — a typical single agent turn, small enough that every request is billed at the base rate.

| Request | Cost |
| --- | --- |
| Cold prompt, nothing cached | $0.0450 |
| Warm prompt, 90% of the input served from cache | $0.0248 |


## API surfaces

The Vivgrid Console catalogs `gpt-5.1-codex` on one surface, all behind the same API key. The endpoint shown is the one the Console previews for that surface.

| Surface | Primary endpoint | Use it for |
| --- | --- | --- |
| Vibe coding | `/responses` | Coding CLIs and IDE agents that drive the model themselves — point the tool at Vivgrid and keep your own loop. |

## Quick start

Get an API key from the Vivgrid Console (https://console.vivgrid.com), then call `gpt-5.1-codex` directly.

```bash
curl https://api.vivgrid.com/v1/responses \
  -H "Authorization: Bearer $VIVGRID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.1-codex",
    "input": "Refactor this function and explain the change.",
    "stream": true
  }'
```


## Ideal use cases

- Day-to-day coding agents on the Responses API
- Globally distributed teams needing low latency in three regions
- Automated edits, reviews, and test generation
- Tool-calling workflows that chain editor and shell actions

## Related models

- [gpt-6-astra](/docs/models/gpt-6-astra) — the gpt-6 generation flagship
- [gpt-5.3-codex](/docs/models/gpt-5.3-codex) — the current Codex generation
- [gpt-6.1-sol](/docs/models/gpt-6.1-sol) — the balanced gpt-6 coding model
