--- id: openai-codex version: "0.144.4" license: Apache-2.0 license_treatment: permissive maintenance: active --- # openai-codex — Python SDK for Codex License: permissive · Maintenance: active · Downloads: 236.4K/mo ## 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 above — verify before relying. Python SDK for building applications that interact with OpenAI Codex, enabling thread creation, turn execution, streaming, and workspace access control through a context-managed interface. 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 pip install openai-codex uv add openai-codex poetry add openai-codex ## Installing openai-codex 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. 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) 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. 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_current - Install friction: low - Maintenance: active - Downloads: 236.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags openai codex python sdk, codex thread management, llm agent framework python, codex authentication sdk, ai workspace control library, llm-sdk, code-generation, ai-agents [View on SkillFed](https://skillfed.io/packages/openai-codex) · [View on PyPI](https://pypi.org/project/openai-codex/)