openai-codex
Python SDK for Codex
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and is licensed permissively under Apache-2.0. Install it if you need to programmatically interact with OpenAI Codex from Python; the context-managed API and built-in authentication handling make it straightforward to integrate into applications.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; existing Codex authentication must be available or you must authenticate via ChatGPT login, device code, or API key before running turns.
- Low install friction with only two runtime dependencies (pydantic and openai-codex-cli-bin).
- Active maintenance with a recent release 28 days ago and ongoing repository activity.
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely as long as you include the license notice.
last release 2026-07-17 (28 days) · last repo commit 2026-08-14 · 105,971 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 236,449 downloads/mo, #8,984 on PyPI
Alternatives
Verify before relying
pip install openai-codex
from openai_codex import Codex
with Codex() as codex:
thread = codex.thread_start()
result = thread.run("Explain this repository in three bullets.")
print(result.final_response)- Whether openai-codex-cli-bin is a system binary dependency or a Python package that must be installed separately.
- What 'workspace access control' concretely enables—whether it restricts file/directory scope, user permissions, or something else.
- Whether the SDK supports streaming responses in real time or only returns final results.
What it is and what it does
OpenAI Codex Python SDK is a client library for building applications that interact with Codex, OpenAI's code generation and understanding model. It provides a context-managed interface to start threads, execute turns (prompts), and retrieve results including final responses and token usage. The SDK handles authentication automatically when credentials are already available, and supports explicit login flows via ChatGPT browser login, device-code flow, or API key.
The package is designed for developers building AI-assisted tools and agents that need to run Codex operations programmatically. It depends on pydantic for data validation and openai-codex-cli-bin for underlying binary support. The SDK is actively maintained, recently released, and carries no known vulnerabilities.
Use it for
- Build an automated code review tool that uses Codex to analyze and explain repository structure and code patterns.
- Create an AI agent that generates or refactors code by running Codex turns in response to user prompts.
- Integrate Codex into a development IDE or editor plugin to provide inline code explanations and suggestions.
- Batch-process multiple code repositories to extract summaries, documentation, or architectural insights.
- Implement multi-turn conversations with Codex where each turn builds on previous context and results.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has low install friction, carries no known vulnerabilities, and is licensed permissively under Apache-2.0. Install it if you need to programmatically interact with OpenAI Codex from Python; the context-managed API and built-in authentication handling make it straightforward to integrate into applications.
Install
openai-codex on PyPI
Before you install
Low install friction with only two runtime dependencies (pydantic and openai-codex-cli-bin). Active maintenance with a recent release 28 days ago and ongoing repository activity.
Requires Python 3.10 or later; existing Codex authentication must be available or you must authenticate via ChatGPT login, device code, or API key before running turns.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely as long as you include the license notice.
Quickstart
pip install openai-codex
from openai_codex import Codex
with Codex() as codex:
thread = codex.thread_start()
result = thread.run("Explain this repository in three bullets.")
print(result.final_response)
Verify before relying
- Whether openai-codex-cli-bin is a system binary dependency or a Python package that must be installed separately.
- What 'workspace access control' concretely enables—whether it restricts file/directory scope, user permissions, or something else.
- Whether the SDK supports streaming responses in real time or only returns final results.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespydanticopenai-codex-cli-bin |
| Maintenance | Actively maintained 28 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 236,449 / month, #8,984 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersTopic :: Software Development :: Libraries :: Python Modules |
Evidence: openai_codex-0.144.4-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “openai codex python sdk”
- openai-codexPython SDK for building applications that interact with OpenAI Codex,…
- openai-codex-cli-binProvides a local command-line interface to OpenAI's Codex coding…
- cisco-ai-skill-scannerScans AI Agent Skills for prompt injection, data exfiltration, and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also openai-codex-cli-bin · openhands-workspace · openai-agents · openhands-sdk · openhands-tools · opentelemetry-instrumentation-openai-agents · portkey-ai · llama-index-llms-openai · composio-openai-agents · langgraph-sdk