Reverse engineering Codex CLI to get GPT-5-Codex-Mini to draw me a pelican
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
The undocumented Codex backend endpoint and its auth mechanism are now exposed, letting anyone with a ChatGPT account prompt restricted OpenAI models directly before public API access opens.
OpenAI quietly launched a smaller, cheaper AI model called GPT-5-Codex-Mini, but only inside its own coding tool, Codex CLI, rather than letting anyone call it directly. Simon Willison, a well-known programmer, used the tool itself to write code that adds a new command to Codex CLI, letting him send his own prompts straight to the hidden model. He wrote none of the Rust programming language himself, instead instructing an AI agent to do it. The hack works, and he tested it by having the models draw pictures of pelicans.
OpenAI's new cost-efficient GPT-5-Codex-Mini is currently gated behind its Codex CLI coding agent, which uses an undocumented chatgpt.com backend API billed to ChatGPT accounts. Willison demonstrated that the open-source Apache 2.0 Codex CLI can be modified to expose this restricted endpoint directly, bypassing the intended access path ahead of the promised public API. The takeaway: 'exclusive' tool-gated model launches are only as secure as the open-source client that ships with them.
Willison forked openai/codex (rewritten in Rust a few months ago) and had Codex itself, running with --dangerously-bypass-approvals-and-sandbox, build the repo and add a 'codex prompt' subcommand modelled on his llm tool. It posts to https://chatgpt.com/backend-api/codex/responses using Codex's own auth; calls without Codex's expected instructions fail with 400 'Instructions are not valid', so the subcommand keeps workspace defaults but disables tools and apply_patch via config overrides. A --debug flag dumps the full JSON request/response. Qualitatively, gpt-5 produced the best SVG pelican; gpt-5-codex-mini produced a worse one than gpt-5-codex.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
GPT-5-Codex-Mini Codex CLI OpenAI Rust Simon Willison chatgpt.com backend API
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code-driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game-changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross-platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.