Proposal: Add Python SDK for Codex

Resolved 💬 11 comments Opened Oct 18, 2025 by masterFoad Closed Mar 29, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

I've developed a complete Python SDK for Codex that provides:

  • Full Python API for all Codex functionality
  • Cross-platform support (Windows, macOS, Linux)
  • Streaming, structured output, thread management
  • Comprehensive examples and documentation

Would this be something you'd be interested in accepting? I can submit a PR if approved.

Additional information

_No response_

View original on GitHub ↗

11 Comments

Provinm · 9 months ago

hi boss, python sdk is very necessary!

darinkishore · 8 months ago
  • how can we get a python SDK merged?
  • can the community contribute to build the python SDK, or is this something you guys would want to do in-house?
  • if the community can contribute, how can we make it easy to review/merge?

would be very helpful for an official response here. i desperately want to build on top of codex. maintaining a fork for rn and have a PR up.

(sorry for @ spam, but it's a really important need for a lot of people)

@pakrym-oai @jif-oai @nornagon-openai

masterFoad · 8 months ago

Hi everyone

In response to the interest here, I already have a substantial portion of the Python SDK implemented and functioning. It includes:

  • A full Python API covering all Codex functionality
  • Cross-platform support (Windows, macOS, Linux)
  • Streaming, structured output, and thread management
  • Comprehensive examples and documentation

I’d be happy to open a PR if there’s interest in reviewing and merging

feifei325 · 8 months ago

That's great. I also have such a plan recently.

yor-dev · 8 months ago

I also developed a personal Codex Python SDK (similar to Mr. masterFoad's), but ideally an official Python SDK supported by OpenAI would be preferable.
https://github.com/yor-dev/python-codex-sdk

Zidane786 · 8 months ago
Hi everyone In response to the interest here, I already have a substantial portion of the Python SDK implemented and functioning. It includes: A full Python API covering all Codex functionality Cross-platform support (Windows, macOS, Linux) Streaming, structured output, and thread management Comprehensive examples and documentation I’d be happy to open a PR if there’s interest in reviewing and merging

Is it possible to open-source it as a separate repo till the time, openai decide to merge it,if it's on pypi would like to know package name

andrewmaspero · 7 months ago

Yes please this is needed.... can't wait to use this with PydanticAI :)

comfuture · 6 months ago

I’ve created a rough Python SDK for Codex here: comfuture/codex-sdk-python.

Since the OpenAI Codex team is currently not accepting PRs for new features, anyone who needs a Python SDK for Codex can use this repository as a starting point.

spdcoding · 5 months ago

I just released codex-python-sdk 🐍
A super lightweight Python SDK for Codex—one context manager and you’re ready.

Repo: https://github.com/spdcoding/codex-python-sdk

from codex_python_sdk import create_client

with create_client() as client:
    result = client.responses_create(prompt="Reply with exactly: READY")
    print(result.session_id)
    print(result.text)
````

Feedback / PRs welcome!
luzhongqiu · 4 months ago

+1 python sdk

etraut-openai contributor · 3 months ago

There is now an experimental Python sdk available.