Unofficial Python SDK for OpenAI Codex CLI. This is a port of the official TypeScript SDK.
Based on commit 3f1c4b9 (Nov 15, 2025) from the official repository.
Embed the Codex agent in your workflows and apps.
The Python SDK wraps the bundled codex binary. It spawns the CLI and exchanges JSONL events over stdin/stdout.
pip install python-codex-sdkRequires Python 3.12+ and the Codex CLI.
See the examples/ directory for usage samples.
uv run pytestCurrently tested with codex-cli 0.58.0.
Apache-2.0