Codex

Codex API

Call OpenAI's GPT-5-Codex models — the models behind the Codex coding agent — directly from your app with Puter.js. No CLI to install, no API keys, no backend.

// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';

puter.ai.chat("Explain quantum computing in simple terms", {
    model: "openai/gpt-5.3-codex"
}).then(response => {
    console.log(response.message.content);
});
<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat("Explain quantum computing in simple terms", {
            model: "openai/gpt-5.3-codex"
        }).then(response => {
            document.body.innerHTML = response.message.content;
        });
    </script>
</body>
</html>

The Codex API for Agentic Coding

Agentic Coding

GPT-5-Codex models are optimized for writing, editing, and reviewing code across multi-step tasks.

Up to 400K Context

Large context windows let Codex reason over entire repositories and long files in a single call.

Long-Horizon Tasks

Built for autonomous, multi-step software work with reliable tool calling and self-correction.

A Model for Every Job

Pick the full Codex models for hard problems or the Mini variants for fast, cheap subagents.

Frontier Reasoning

The GPT-5 family brings frontier reasoning to debugging, refactoring, and architectural work.

No CLI, No Keys

Call the models directly in your app — no Codex CLI, no API key, and users cover their own usage.

Codex Models Compared

Every Codex model available through Puter.js, with context, output limits, and per-million-token pricing. Click a model for full specs and examples.

ModelContextMax OutputInput / 1MOutput / 1M
GPT-5.3 Codex openai/gpt-5.3-codex 128K 128K $1.75 $14
GPT-5.2 Codex openai/gpt-5.2-codex 128K 128K $1.75 $14
GPT-5.1 Codex Max openai/gpt-5.1-codex-max 400K 128K $1.25 $10
GPT-5.1 Codex openai/gpt-5.1-codex 128K 128K $1.25 $10
GPT-5.1 Codex Mini openai/gpt-5.1-codex-mini 128K 128K $0.25 $2
GPT-5 Codex openai/gpt-5-codex 400K 128K $1.25 $10

Which Codex Model Should You Use?

Pick the Codex model that fits your workload — capability, latency, or cost.

Most capable

GPT-5.3 Codex

GPT-5.3 Codex is OpenAI's GPT-5-Codex models, purpose-built for agentic coding and large-scale software work, with a 128K-token context window. Use it as your default for agentic coding and large-scale refactoring.

View GPT-5.3 Codex →
Proven & cost-aware

GPT-5.2 Codex

Other versions like GPT-5.2 Codex stay available for pinned, reproducible deployments and cost-sensitive workloads that don't need the very latest model.

View GPT-5.2 Codex →

Use Codex in Seconds

Add Codex to your app with just a few lines of code.
No API keys, no backend, no configuration required.

// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';

puter.ai.chat("Explain quantum computing in simple terms", {
    model: "openai/gpt-5.3-codex"
}).then(response => {
    console.log(response.message.content);
});
<html>
<body>
    <script src="https://js.puter.com/v2/"></script>
    <script>
        puter.ai.chat("Explain quantum computing in simple terms", {
            model: "openai/gpt-5.3-codex"
        }).then(response => {
            document.body.innerHTML = response.message.content;
        });
    </script>
</body>
</html>

View full documentation →

Frequently Asked Questions

What is the Codex API?

The Codex API gives you access to OpenAI's GPT-5-Codex models, purpose-built for agentic coding and large-scale software work — including GPT-5.3 Codex — through Puter.js. You can call any Codex model from your app with no API keys and no backend.

Is the Codex API free?

Yes, it is free for you as the developer when you use it through Puter.js. With the User-Pays model, each of your users covers their own usage through their Puter account, so you can ship Codex-powered apps at no cost to you.

Which Codex model should I use?

Start with GPT-5.3 Codex as your default. Other versions like GPT-5.2 Codex suit pinned, cost-aware deployments.

How much does Codex cost?

GPT-5.3 Codex is priced at $1.75 per million input tokens and $14 per million output tokens at the API level. Through Puter.js it is free for developers under the User-Pays model.

What is the context window of Codex?

GPT-5.3 Codex supports a context window of 128K tokens and can generate up to 128K tokens in a single response.

Do I need an API key?

No. Puter.js handles authentication and infrastructure for you, so you can use the Codex API without any API key, an OpenAI account, a server, or any configuration.

Does it work with React / Vue / Vanilla JS / Node / etc.?

Yes — the Codex API through Puter.js works with any JavaScript framework, Node.js, or plain HTML. Just include the library and start building.