Skip to content

Proposal: Add Python SDK for Codex #5320

Closed

Description

@masterFoad

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

Activity

  1. added
    enhancement
    on Oct 18, 2025
  2. Provinm commented on Oct 23, 2025

    @Provinm

    hi boss, python sdk is very necessary!

  3. darinkishore commented on Oct 25, 2025

    @darinkishore
    • 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

  4. masterFoad commented on Oct 26, 2025

    @masterFoad
    Author

    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

  5. feifei325 commented on Oct 28, 2025

    @feifei325

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

  6. added
    sdk
    on Nov 15, 2025
  7. yor-dev commented on Nov 16, 2025

    @yor-dev

    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

  8. Zidane786 commented on Nov 18, 2025

    @Zidane786

    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

  9. andrewmaspero commented on Nov 27, 2025

    @andrewmaspero

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

  10. comfuture commented on Jan 7, 2026

    @comfuture

    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.

  11. marked python SDK #9808 as a duplicate of this issue on Jan 24, 2026
  12. spdcoding commented on Feb 17, 2026

    @spdcoding

    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!

  13. luzhongqiu commented on Mar 6, 2026

    @luzhongqiu

    +1 python sdk

  14. etraut-openai commented on Mar 29, 2026

    @etraut-openai
    Contributor

    There is now an experimental Python sdk available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsdk

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions