OpenAI GPT Codex: AI Text Generator

OpenAI GPT Codex delivers advanced coding capabilities with scalable reasoning depth. Supports multiple model variants (gpt-5-codex through gpt-5.4-codex) and multimodal inputs. Token-based pricing: $1.25/M input tokens, $9.00/M output tokens. Two endpoints: standard async (/gpt-codex) and live streaming (/gpt-codex/stream) via SSE.

πŸ“

Overview

About this model

GPT Codex is OpenAI's code-specialized model series built on GPT-5 architecture. Optimized for code generation, debugging, and complex engineering workflows with scalable reasoning depth. Supports five model variants from gpt-5-codex to gpt-5.4-codex, multimodal inputs, and SSE streaming. Token-based pricing: $1.25 per million input tokens and $9.00 per million output tokens.

1Code Generation: Write complete, production-ready functions, classes, and modules from natural language.
2Debugging: Identify and fix bugs with deep understanding of code logic and edge cases.
3Code Review: Analyze code for correctness, performance, security, and style.
4Engineering Workflows: Automate repetitive coding tasks, generate tests, and produce documentation.
πŸ’°

Pricing & Value

Cost analysis

muapiapp$1.25/M input tokens, $9.00/M output tokens

Token-based billing. Minimum $0.00023 per call. All 5 Codex variants share the same pricing. Supports Prompt Caching (0.1x for hits, 1.25x for creation).

OpenAI (official)~$1.75/M input tokens, ~$14.00/M output tokens

Official pricing via api.openai.com.

Fal.aiNot available

GPT Codex is not available on Fal.ai.

* Competitor pricing is estimated based on similar model architectures and usage tiers.

βš™οΈ

Technical Details

Configuration schema

Promptstring

The coding task or instruction.

Default ValueImplement a binary search tree with insert, delete, and search methods in Python.
ModelEnum (5 options)

Codex model variant to use.

Default Valuegpt-5.4-codex
Image URLstring

Optional image URL for multimodal requests.

Default Valueundefined
πŸ“–

Implementation Guide

Developer documentation

Standard (Async)

POST /api/v1/gpt-codex β€” returns request_id, poll for result via /api/v1/predictions/{id}/result.

Streaming (SSE)

POST /api/v1/gpt-codex/stream β€” returns a live SSE stream. Each chunk: data: {"choices":[{"delta":{"content":"text"}}]}, ending with data: [DONE].

Model variants (pass in the model field): gpt-5.4-codex (default, most capable), gpt-5.3-codex, gpt-5.2-codex, gpt-5.1-codex, gpt-5-codex.

See Streaming Documentation for full code examples.

❓

Common Questions

Frequently asked

How is pricing calculated?

Pricing is token-based: $1.25 per million input tokens and $9.00 per million output tokens regardless of which Codex model variant you use. The minimum charge per call is $0.00023.

Which Codex variant should I use?

gpt-5.4-codex is the default and most capable variant. Use lower variants (gpt-5.3-codex, gpt-5.2-codex, etc.) if you need faster responses for simpler tasks. All variants share the same pricing.

What is the difference between /gpt-codex and /gpt-codex/stream?

/gpt-codex is async β€” you receive a request_id and poll for the result. /gpt-codex/stream returns a live SSE stream. Use streaming for interactive coding UIs; use the async endpoint for batch processing.

Does this model support Prompt Caching?

Yes. Prompt Caching allows you to reuse frequently used text prompts at reduced rates. Cache hits (reusing previously cached tokens) are charged at 0.1x of the input cost. New cache creation (writing new tokens to cache for future reuse) is charged at 1.25x of the standard input cost.