OpenAI
gpt-5.1-codex
openai/gpt-5.1-codex
Price per million tokens
- Input
- $1.583
- Output
- $12.660
- Cache write
- not offered
- Cache read
- $0.165
What you pay. It is what the tokens cost us to buy plus 20%, and your usage page shows what we paid beside what you paid on every request you send.
Limits
- Context window
- 400,000 tokens
- Max output
- 128,000 tokens
- Images
- supported
What it costs to run
| Workload | Input | Output | Cost | Per 1,000 calls |
|---|---|---|---|---|
| Short chat turn | 1,000 | 500 | $0.0079 | $7.91 |
| Long document summary | 50,000 | 2,000 | $0.1044 | $104.45 |
| Agent step with tools | 20,000 | 1,500 | $0.0506 | $50.64 |
| 1M in, 1M out | 1,000,000 | 1,000,000 | $14.2425 | $14242.50 |
Calling it
const res = await client.chat.completions.create({ model: "openai/gpt-5.1-codex", messages: [{ role: "user", content: "Hello" }], });