YepAPI
OpenAIText Generation/v1/ai/chat

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 typePrice
Input$1.85 / 1M tokens
Output$14.77 / 1M tokens
Context window400K tokens
What it costsPer jobPer 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.

POST/v1/ai/chat

Maximum tokens in the response.

Real-time tokens

Hit "Send Request" to see the response

GPT-5.1 Codex Max specs

ProviderOpenAI
Model IDopenai/gpt-5.1-codex-max
Endpoint/v1/ai/chat
TypeText Generation
Context window400K tokens
Max output128K tokens
ReasoningNo
OpenAI-compatibleYes — /v1/ai/chat/completions

How to get a GPT-5.1 Codex Max API key

  1. 1

    Create an account

    Sign up at yepapi.com with Google or email. It takes about 30 seconds.

  2. 2

    Create an API key

    Open the dashboard, go to API Keys and create a key. Copy it — it starts with yep_sk_.

  3. 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. 4

    Pay as you go

    Usage is billed per request from your balance. Top up any amount; there is no subscription.

Strengths

✓
Max output tokens

GPT-5.1 Codex Max supports up to 128,000 output tokens, letting it generate entire files or large codebases in a single response.

✓
400K context

A 400,000-token context window lets it read large, multi-file projects before generating code.

✓
Codebase generation

Built to scaffold whole applications — routes, models, and configuration — in one pass rather than fragment by fragment.

✓
Cost-effective

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.

ModelProviderPriceContext
GPT-5.1 Codex MaxOpenAI$1.85 in / $14.77 out per 1M400K
GPT-6 LunaOpenAI$0.15 in / $0.74 out per 1M1.1M
GPT-6 Luna ProOpenAI$0.15 in / $0.74 out per 1M1.1M
GPT-4o MiniOpenAI$0.22 in / $0.89 out per 1M128K
GPT-OSS 120BOpenAI$0.22 in / $0.89 out per 1M131K
GPT-5.6 LunaOpenAI$0.30 in / $1.77 out per 1M1.1M
Nemotron 3 SuperNVIDIA$0 in / $0 out per 1M262K
Qwen3.7 FlashQwen$0.04 in / $0.19 out per 1M1M

Why use GPT-5.1 Codex Max through YepAPI?

✓One API key for all models — no separate accounts
✓OpenAI SDK compatible — just change the base URL
✓No monthly minimums — pay per token
✓Switch models with one line of code
✓Full provider passthrough — citations, search results, and all extras included
✓Streaming and non-streaming support on every model
✓Works with Cursor, Claude, LangChain, and any LLM tool
✓Unified billing across all providers

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.

Start generating in 30 seconds

Pay per call, no subscriptions.

What developers say

“Switched from SerpAPI and cut our SERP costs by 80%. Same data quality, way simpler billing.”

Marcus T.

SEO Platform Founder

“One API key for AI models, SERP data, and web scraping. Saved us from managing 4 separate providers.”

Priya S.

Full-Stack Developer

“The $5 free credit let us prototype our entire rank tracking feature before committing. No other API does that.”

Jake R.

Indie Hacker

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.

Ready to use GPT-5.1 Codex Max?

Pay per call, no subscriptions.

Explore more models