Python SDK for Codex
Project description
OpenAI Codex Python SDK (Beta)
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openai_codex-0.1.0b2.tar.gz.
File metadata
- Download URL: openai_codex-0.1.0b2.tar.gz
- Upload date:
- Size: 57.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44dd51f004ce2ed51cf7b9f34e8b2e6a207ab06e8739b45d5a0cfe338e460587
|
|
| MD5 |
3c3ca91768ab627d9613a55c6ef4458e
|
|
| BLAKE2b-256 |
6fb7216fa0e7725c33791fe97621c663a9ec0e6e98c2240bffae89661de55602
|
Provenance
The following attestation bundles were made for openai_codex-0.1.0b2.tar.gz:
Publisher:
python-sdk-release.yml on openai/codex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openai_codex-0.1.0b2.tar.gz -
Subject digest:
44dd51f004ce2ed51cf7b9f34e8b2e6a207ab06e8739b45d5a0cfe338e460587 - Sigstore transparency entry: 1651949045
- Sigstore integration time:
-
Permalink:
openai/codex@46946bb91c25b45dec125e29a933b019c61856ff -
Branch / Tag:
refs/tags/python-v0.1.0b2 - Owner: https://github.com/openai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-sdk-release.yml@46946bb91c25b45dec125e29a933b019c61856ff -
Trigger Event:
push
-
Statement type:
File details
Details for the file openai_codex-0.1.0b2-py3-none-any.whl.
File metadata
- Download URL: openai_codex-0.1.0b2-py3-none-any.whl
- Upload date:
- Size: 64.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9edf0871e9e0d6e3951cd6c3b9b187641e6247d9413402dfc66ac3a5f6ba66ff
|
|
| MD5 |
45fc635ce8626bf0b4c25761455b1c29
|
|
| BLAKE2b-256 |
b63859e86bc20bdd4390faa979d2a0235d7be60ae895cd3ac6a92a49bfe080a7
|
Provenance
The following attestation bundles were made for openai_codex-0.1.0b2-py3-none-any.whl:
Publisher:
python-sdk-release.yml on openai/codex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openai_codex-0.1.0b2-py3-none-any.whl -
Subject digest:
9edf0871e9e0d6e3951cd6c3b9b187641e6247d9413402dfc66ac3a5f6ba66ff - Sigstore transparency entry: 1651949164
- Sigstore integration time:
-
Permalink:
openai/codex@46946bb91c25b45dec125e29a933b019c61856ff -
Branch / Tag:
refs/tags/python-v0.1.0b2 - Owner: https://github.com/openai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-sdk-release.yml@46946bb91c25b45dec125e29a933b019c61856ff -
Trigger Event:
push
-
Statement type: