OpenAI
GPT-5.1 Codex
GPT-5.1 Codex specializes GPT-5.1 for software engineering, from interactive development to extended independent assignments. It can create projects, add features, debug, refactor large repositories, and review code while following developer instructions closely. Adjustable reasoning effort supports both small changes and sustained work. Image inputs help with interface development, and tools support search, dependency installation, environment setup, and checking behavior against tests.
Our price
input / output per 1M
Official
USD · Published rate · Updated 2026-10-06
First request
Availablecurl https://api.tokely.me/v1/responses \
-H "Authorization: Bearer $TOKELY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.1-codex",
"input": "Hello!",
"max_output_tokens": 1024,
"store": false
}'Set TOKELY_API_KEY to your dashboard key. Requests require a funded Tokely balance. Base URL: https://api.tokely.me/v1.
Capabilities & limits
- Context window
- 400,000 tokens
- Model max output
- 128,000 tokens
- Cached input price
- $0.100834 per 1M tokens · Official: $0.125
- Provider
- OpenAI
- API model ID
gpt-5.1-codex- Category
- Text
- Endpoints
POST /v1/responses- Tokely max output
- 65,536 tokens / request, including reasoning tokens
- Default output
- 256 tokens. Set an explicit limit for longer responses.
- Request limits
- 256 KB JSON body · 128 messages · 32 function tools
- Rate limit
- 60 requests / minute / account, across its keys
- Supported input
- Text messages and function tool results
- Model modalities
- text, image. Tokely currently accepts text input.
The context includes your instructions, conversation history, tool definitions and generated output. Keep the input and requested output within the model’s context window.
API reference
Authenticate with Authorization: Bearer YOUR_TOKELY_API_KEY. Use an OpenAI SDK with the Tokely base URL.
- model
- Required string:
gpt-5.1-codex - input
- Text or an array of text messages and function call results. Send history in each request; use store=false.
- max_output_tokens
- Optional integer, 1–65,536. Defaults to 256.
- stream
- Streaming has not been verified for this model.
- reasoning.effort
- Optional reasoning effort. Supported values depend on the model; omit to use its default.
- tools
- Function definitions executed by your application. Provider-hosted tools are not enabled.
The response contains output items and usage (input_tokens, output_tokens, total_tokens). Streaming uses named Responses events.
- 400 / 415
- Invalid request, parameter, endpoint for this model, or content type.
- 401 / 403
- Invalid, revoked or restricted API key.
- 402
- Insufficient account balance or API key budget.
- 429
- Request limit reached. Retry after the indicated delay.
- 502 / 503 / 504
- Upstream failure, temporary service unavailability or request timeout.
Compare nearby prices
| Model | Input | Output | Context |
|---|---|---|---|
| GPT-5.1 CodexOpenAI · this model | $1.008334 | $8.066667 | 400,000 |
| GPT-5.3 CodexOpenAI | $1.05875 | $8.47 | 400,000 |
| GPT-6 AstraOpenAI | $2.527938 | $7.583813 | 1,050,000 |
| Gemini 3 ProGoogle | $0.833334 | $5.833334 | 128,000 |
| Gemini 3.1 ProGoogle | $0.833334 | $5.833334 | 128,000 |
Frequently asked questions
How much does GPT-5.1 Codex cost?
$1.008334 per million input tokens, $8.066667 per million output tokens and $0.100834 per million cached input tokens. Usage is charged to your Tokely balance.
Do I need a separate OpenAI account?
Use your Tokely API key and balance. A separate provider key is not required.
How do I switch to this model?
Set model to gpt-5.1-codex and use /v1/responses. Keep your Tokely base URL and API key.
What is the context window?
400,000 tokens, including input and output. The Tokely request body and output limits listed above also apply.
Playground
Explore this model in the Tokely Playground.
Open in playground