Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openai_codex-0.1.0b3.tar.gz (59.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openai_codex-0.1.0b3-py3-none-any.whl (65.6 kB view details)

Uploaded Python 3

File details

Details for the file openai_codex-0.1.0b3.tar.gz.

File metadata

  • Download URL: openai_codex-0.1.0b3.tar.gz
  • Upload date:
  • Size: 59.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openai_codex-0.1.0b3.tar.gz
Algorithm Hash digest
SHA256 b76b7afe97953ac65648e9b8ca116b5ff273de91086549bd7ec88037cdc16cab
MD5 c39214d17a4be1e853746dd5abc46cc5
BLAKE2b-256 ae1c1e5e8b83ea72164d32b1f4e67fc703c8b83591f498a7aaf96f39d352b453

See more details on using hashes here.

Provenance

The following attestation bundles were made for openai_codex-0.1.0b3.tar.gz:

Publisher: python-sdk-release.yml on openai/codex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openai_codex-0.1.0b3-py3-none-any.whl.

File metadata

  • Download URL: openai_codex-0.1.0b3-py3-none-any.whl
  • Upload date:
  • Size: 65.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openai_codex-0.1.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 8d1f9d346667aeecb435c6a45d0edb3f016187276ec452cf8094d813896276c4
MD5 904f147d2a42d6e252bc4b408b2c2236
BLAKE2b-256 d7eff77037d9ccde80a688a17a06aea5a56813ad9c365d49b3f1c7913422af8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for openai_codex-0.1.0b3-py3-none-any.whl:

Publisher: python-sdk-release.yml on openai/codex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page