Pi vs OpenAI Codex: A Minimal MIT Harness on Many Providers vs OpenAI's Agent Across Terminal, IDE, Desktop and Cloud
Pi
A minimal, extensible, MIT-licensed agent harness for coding and beyond
OpenAI Codex
Autonomous cloud-based AI coding agent — delegate tasks, walk away, get a finished PR
Verdicts by Task
OpenAI offers Codex Web at chatgpt.com/codex, and the pricing page lists Plus as including Codex on the web.
The pi.dev pages we read describe no hosted service, so the gap is a product Pi does not ship versus one you would build. We tested neither.
Pi ships extensions, skills, prompt templates and themes as Pi packages.
Codex also has a TypeScript SDK, a Python SDK and an App Server for custom clients. We tested neither.
pi.dev lists 15+ providers and local runners.
The Codex README we read names only ChatGPT sign-in and an API key, and Pi also lists OpenAI, so OpenAI models are reachable from both. We did not test whether a ChatGPT plan works inside Pi.
OpenAI documents read-only, workspace-write and danger-full-access modes enforced by Seatbelt, bubblewrap or the native Windows sandbox, while the Pi pages we read do not state that Pi sandboxes itself.
Danger-full-access removes the boundary, and Pi's recommended answer is to run it in a container or VM, which also works for Codex.
The README offers "Sign in with ChatGPT", and the pricing page lists Codex on the web, in the CLI, in the IDE extension and on iOS under Plus.
Pi's models doc mentions sign-in through /login for supported subscriptions, but we did not confirm that a ChatGPT plan is one.
Feature Comparison
| Dimension | Pi | OpenAI Codex |
|---|---|---|
| AI-native | AI-Native | AI-Native |
| What it is | Pi site: "Pi is a minimal agent harness. Adapt Pi to your workflows, not the other way around." It runs in interactive, print/JSON, RPC and SDK modes. | The Codex repository calls it a "Lightweight coding agent that runs in your terminal". OpenAI's docs list Codex as available on the CLI, IDE extension, desktop app and cloud/web. |
| Licence | MIT, per the GitHub README and pi.dev. | The Codex CLI repository is Apache-2.0. The README points to Codex Web at chatgpt.com/codex as the cloud-based agent, and we read no licence for it. |
| Surfaces and install | Install with a curl script, a PowerShell script, or npm, pnpm or bun; the README says it needs Node.js 22.19 or newer. Modes: interactive, print/JSON, RPC and a TypeScript SDK. | Install with a curl script, a PowerShell script, `npm install -g @openai/codex`, a Homebrew cask or a GitHub release. The README lists IDE integrations for VS Code, Cursor and Windsurf, a desktop app opened with `codex app`, and Codex Web. OpenAI's docs also list a TypeScript library, a Python SDK and a Codex App Server for custom clients. |
| Model access and sign-in | pi.dev lists 15+ providers, including Anthropic, OpenAI, Google, OpenRouter and Ollama, and the models doc covers local runners (llama.cpp, Ollama, LM Studio, vLLM, SGLang). The models doc also lists sign-in through /login for a supported subscription. | The README lists two sign-in routes, "Sign in with ChatGPT" or an API key, and names no other model provider. The pricing page says that with an API key you "Pay for Codex usage based on API pricing". |
| Cloud and remote work | Pi has an RPC mode for controlling separate processes and an SDK for running it inside applications. The pi.dev front page mentions no hosted service. | OpenAI points to Codex Web at chatgpt.com/codex as its cloud-based agent. The pricing page says the Plus plan includes "Codex on the web, in the CLI, in the IDE extension, and on iOS". |
| Permissions and sandboxing | Security docs: "Pi can read, change, and execute files with the permissions of the account that started it, and it does not ask for approval before every tool call." Running Pi "entirely inside a container, virtual machine, or sandbox" is "usually the strongest practical option". The containerization page lists Plain Docker, Docker Sandboxes, OpenShell and a Gondolin extension and does not state that Pi sandboxes itself. | OpenAI's sandboxing doc names three sandbox modes: read-only, workspace-write (the default for local work) and danger-full-access (no filesystem or network restrictions). Approval policies include on-request and never. Enforcement uses Seatbelt on macOS, bubblewrap on Linux and WSL2, and the native Windows sandbox in PowerShell. |
| Pricing | Free to install under MIT. The pi.dev front page mentions no price, paid plan or hosted service, so you pay for whichever provider key or subscription you connect. | OpenAI's pricing page lists ChatGPT Free at $0 a month, Go at $8, Plus at $20 and Pro from $100. Plus includes Codex on the web, in the CLI, in the IDE extension and on iOS. With an API key you pay API pricing for Codex usage. |
Pi is a harness you shape in a terminal. Codex is OpenAI's agent across several surfaces.
Both terminal agents can be audited and forked. The cloud agent is a separate product with no licence stated on the pages read.
Codex covers more surfaces out of the box.
Pi lets you mix providers and local models. Codex, on the pages we read, runs on OpenAI sign-in or an OpenAI API key.
Codex ships a hosted agent and a phone surface. With Pi you build or host that layer yourself.
Codex documents a sandbox with named modes and an OS-level mechanism. The Pi pages we read do not state that Pi sandboxes itself, and its security page recommends running it in a container, VM or sandbox. Danger-full-access removes Codex's boundary.
Not like-for-like. Pi's cost is the provider you connect. Codex's is a ChatGPT plan or API usage.
Still deciding between these two?
Choosing is the easy part. Getting it running inside your business, on your data, with your team using it, is the work. We do both.
The conversation runs on Gnosari, one of the tools in this directory. A real conversation, not a sales script.