codex template supports CODEX_API_KEY or OPENAI_API_KEY.
Run Codex
Create a sandbox from thecodex template, run Codex headlessly, and clean up.
The SDK and CLI paths are equivalent — use the one that matches your workflow.
Interactive terminal
Open a PTY instead of a headless run to drive Codex interactively:session_id from sandbox pty create with --session-id.
Work on a cloned repository
Schema-validated output
Streaming events
Use--json to emit JSONL events on stdout: