GPT-5.1 Codex Max API
Access GPT-5.1 Codex Max through one API key. Max-output coding model.
OpenAI's earlier generation max-output coding model. 128K output tokens for generating entire codebases.
Takes 30 seconds.
GPT-5.1 Codex Max API pricing
Pay per request from your YepAPI balance — no subscription, no monthly minimum. Prices updated September 27, 2026.
| Token type | Price |
|---|---|
| Input | $1.85 / 1M tokens |
| Output | $14.77 / 1M tokens |
| Context window | 400K tokens |
| What it costs | Per job | Per 1,000 |
|---|---|---|
| Chat reply1K input + 500 output tokens | $0.0092 | $9.24 |
| RAG answer8K input + 800 output tokens | $0.027 | $26.62 |
| Agent step with tools30K input + 2K output tokens | $0.085 | $85.04 |
| Long document summary100K input + 2K output tokens | $0.215 | $214.54 |
4,900+
Developers
2.3M+
API calls served
184
Endpoints
$0.01
Per call
Yep, that's it.
Try it live
Send a message and see GPT-5.1 Codex Max respond in real time.
Maximum tokens in the response.
Real-time tokens
GPT-5.1 Codex Max specs
| Provider | OpenAI |
|---|---|
| Model ID | openai/gpt-5.1-codex-max |
| Endpoint | /v1/ai/chat |
| Type | Text Generation |
| Context window | 400K tokens |
| Max output | 128K tokens |
| Reasoning | No |
| OpenAI-compatible | Yes — /v1/ai/chat/completions |
How to get a GPT-5.1 Codex Max API key
- 1
Create an account
Sign up at yepapi.com with Google or email. It takes about 30 seconds.
- 2
Create an API key
Open the dashboard, go to API Keys and create a key. Copy it — it starts with yep_sk_.
- 3
Call GPT-5.1 Codex Max
Send a request to /v1/ai/chat with the x-api-key header and model "openai/gpt-5.1-codex-max".
- 4
Pay as you go
Usage is billed per request from your balance. Top up any amount; there is no subscription.
Strengths
GPT-5.1 Codex Max supports up to 128,000 output tokens, letting it generate entire files or large codebases in a single response.
A 400,000-token context window lets it read large, multi-file projects before generating code.
Built to scaffold whole applications — routes, models, and configuration — in one pass rather than fragment by fragment.
At $1.85 per 1M input and $14.77 per 1M output tokens, it is the most affordable of these large-output OpenAI coders.
Quick start
Copy this snippet and start making calls with GPT-5.1 Codex Max.
const res = await fetch('https://api.yepapi.com/v1/ai/chat', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"model": "openai/gpt-5.1-codex-max",
"messages": [
{
"role": "user",
"content": "Explain API gateways in 2 sentences."
}
],
"maxTokens": 256
}),
});
const { data } = await res.json();
console.log(data.message.content);GPT-5.1 Codex Max vs similar models
Every model below runs on the same API key — switch by changing the model ID.
| Model | Provider | Price | Context |
|---|---|---|---|
| GPT-5.1 Codex Max | OpenAI | $1.85 in / $14.77 out per 1M | 400K |
| GPT-6 Luna | OpenAI | $0.15 in / $0.74 out per 1M | 1.1M |
| GPT-6 Luna Pro | OpenAI | $0.15 in / $0.74 out per 1M | 1.1M |
| GPT-4o Mini | OpenAI | $0.22 in / $0.89 out per 1M | 128K |
| GPT-OSS 120B | OpenAI | $0.22 in / $0.89 out per 1M | 131K |
| GPT-5.6 Luna | OpenAI | $0.30 in / $1.77 out per 1M | 1.1M |
| Nemotron 3 Super | NVIDIA | $0 in / $0 out per 1M | 262K |
| Qwen3.7 Flash | Qwen | $0.04 in / $0.19 out per 1M | 1M |
Why use GPT-5.1 Codex Max through YepAPI?
GPT-5.1 Codex Max API: max-output coding for whole codebases
GPT-5.1 Codex Max is OpenAI's earlier-generation max-output coding model, built to generate entire codebases with up to 128K output tokens and a 400K context window. At $1.85 per 1M input tokens and $14.77 per 1M output tokens, it is the most cost-effective large-output coder in this lineup.
Through YepAPI you reach GPT-5.1 Codex Max with one OpenAI-compatible API key. The same key also covers other models and YepAPI's SEO, SERP, and web-scraping endpoints, so you can generate full apps and collect data from one account.
What is GPT-5.1 Codex Max?
GPT-5.1 Codex Max is OpenAI's earlier-generation coding model optimized for maximum output. Its defining feature is the ability to emit up to 128,000 tokens in a single response, which lets it scaffold entire applications — routes, data models, configuration, and tests — in one pass rather than piecemeal. A 400,000-token context window lets it read large existing projects before generating. Compared with later Codex releases it is positioned as the budget-friendly large-output option, at $1.85 per 1M input and $14.77 per 1M output tokens, making big code generations affordable.
Build with GPT-5.1 Codex Max via YepAPI
Call the OpenAI-compatible /v1/ai/chat endpoint with your YepAPI key. The Chat Completions schema means existing SDKs and code agents work after changing the base URL and model name. Lean on its 128K output to scaffold complete projects in a single call — for example a full app with auth, models, and API routes. One key also unlocks other models plus SEO, SERP, and scraping APIs, so the generated app can be paired with data tooling through one integration.
GPT-5.1 Codex Max API pricing — $1.85 / $14.77 per 1M tokens
GPT-5.1 Codex Max costs $1.85 per 1M input tokens and $14.77 per 1M output tokens, the lowest large-output coding rate in this set. Since its strength is generating very large responses, the favorable output price is what makes whole-codebase generation practical. Billing is per token, so smaller jobs stay cheap and you only pay for the volume of code actually produced.
GPT-5.1 Codex Max for full codebase generation
The model is built for greenfield generation: scaffolding a complete Next.js app, building an entire CRUD service, or producing a full feature set with its supporting files in one response. The 128K output means it does not have to stop and continue, and the 400K context lets it match an existing project's conventions. When the task is 'generate the whole thing,' GPT-5.1 Codex Max is a cost-effective fit.
What developers say
“Switched from SerpAPI and cut our SERP costs by 80%. Same data quality, way simpler billing.”
“One API key for AI models, SERP data, and web scraping. Saved us from managing 4 separate providers.”
“The $5 free credit let us prototype our entire rank tracking feature before committing. No other API does that.”
Frequently asked questions
OpenAI's earlier generation max-output coding model. 128K output tokens for generating entire codebases.
GPT-5.1 Codex Max costs $1.85 per 1M input tokens and $14.77 per 1M output tokens through YepAPI, billed per request with no monthly fee. For example, a chat reply (1K input + 500 output tokens) costs about $0.0092.
Sign up at yepapi.com (Google or email, about 30 seconds), open the dashboard and create an API key. The same key works for GPT-5.1 Codex Max and every other model — no separate OpenAI account or waitlist.
Use "openai/gpt-5.1-codex-max" as the model on /v1/ai/chat. The short alias "gpt-5.1-codex" also works.
Yes. Point the OpenAI SDK at https://api.yepapi.com/v1/ai with your YepAPI key and set model to "openai/gpt-5.1-codex-max". Streaming works the same way, so existing OpenAI code only needs the base URL and key changed.
GPT-5.1 Codex Max supports a 400K token context window with up to 128K output tokens per request.
Explore more models
GPT-5.2
OpenAIAccess GPT-5.2 through one API key. Previous-generation flagship model.
GPT-5.6 Sol
OpenAIAccess GPT-5.6 Sol through one API key. OpenAI GPT-5.6 Flagship for Coding & Agents.
GPT-5.6 Sol Pro
OpenAIAccess GPT-5.6 Sol Pro through one API key. OpenAI GPT-5.6 Sol Pro Reasoning Mode.
Kimi K2.5
Moonshot AIAccess Kimi K2.5 through one API key. Moonshot AI's flagship model.
Seed 2.0 Pro
ByteDanceAccess Seed 2.0 Pro through one API key. ByteDance's flagship Seed 2.0 reasoning model.
DeepSeek R1 0528
DeepSeekAccess DeepSeek R1 0528 through one API key. DeepSeek Open Chain-of-Thought Reasoning.
More Text Generation models
- Gemini 3.5 Flash API · Google
- MiMo-V2.6-Pro-UltraSpeed API · Xiaomi
- Mistral Small 4 API · Mistral
- Step 5 Preview API · StepFun
- Gemini 2.5 Flash API · Google
- Qwen 3.5 27B API · Qwen
- Qwen3.8 Omni Flash API · Qwen
- Grok 4.20 Multi-Agent API · xAI
- Nemotron 3.5 Lightning API · NVIDIA
- GPT-6 Astra API · OpenAI
- GLM 5.2 API · Z.ai
- GLM 5.3 API · Z.ai