Skip to main content
The codex template supports CODEX_API_KEY or OPENAI_API_KEY.

Run Codex

Create a machine from the codex 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:
Use the session_id from machine pty create with --session-id.

Work on a cloned repository

Schema-validated output

Streaming events

Use --json to emit JSONL events on stdout: