Python SDK for Codex
Project Links
Meta
Author: OpenAI
Requires Python: >=3.10
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Developers
Topic
- Software Development :: Libraries :: Python Modules
OpenAI Codex Python SDK
Build Python applications that start Codex threads, run turns, stream progress, and control workspace access.
Install
Install the SDK:
pip install openai-codex
Quickstart
The SDK reuses your existing Codex authentication when one is already available:
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)
thread.run(...) returns a TurnResult containing the final response,
collected items, and token usage.
Authentication
Existing Codex authentication is reused automatically. To start ChatGPT browser login explicitly:
from openai_codex import Codex
with Codex() as codex:
login = codex.login_chatgpt()
print(login.auth_url)
print(login.wait().success)
For device-code login:
with Codex() as codex:
login = codex.login_chatgpt_device_code()
print(login.verification_url, login.user_code)
login.wait()
For API-key login:
with Codex() as codex:
codex.login_api_key("sk-...")
Built-In Help
Use Python's standard help(openai_codex), help(Codex), or
python -m pydoc openai_codex documentation tools.
Documentation
The package is licensed under the repository Apache License 2.0.
0.172.0
Nov 24, 2026
0.171.0
Nov 20, 2026
0.170.0
Nov 18, 2026
0.169.1
Nov 17, 2026
0.169.0
Nov 13, 2026
0.168.0
Nov 13, 2026
0.167.2
Nov 11, 2026
0.167.1
Nov 10, 2026
0.167.0
Nov 06, 2026
0.163.0
Oct 15, 2026
0.162.1
Oct 09, 2026
0.162.0
Oct 08, 2026
0.161.0
Oct 07, 2026
0.160.1
Oct 05, 2026
0.160.0
Oct 01, 2026
0.159.3
Sep 30, 2026
0.159.2
Sep 30, 2026
0.159.1
Sep 29, 2026
0.159.0
Sep 29, 2026
0.158.0
Sep 28, 2026
0.157.1
Sep 26, 2026
0.157.0
Sep 25, 2026
0.156.1
Sep 23, 2026
0.156.0
Sep 22, 2026
0.155.1
Sep 20, 2026
0.154.0
Sep 10, 2026
0.147.0
Aug 18, 2026
0.144.4
Jul 17, 2026
0.1.0b3
Jun 03, 2026
0.1.0b2
May 28, 2026
0.1.0b1
May 28, 2026