OpenAI Releases Python SDK for Programmatic Codex Agent Control

OpenAIOpenAI

OpenAI has released a Python SDK for its Codex agentic coding tool. This allows developers to programmatically integrate Codex's capabilities for complex engineering tasks into their own applications, custom agents, and CI/CD pipelines.

OpenAI has released a Python SDK (Software Development Kit) for its Codex (an AI agentic coding tool), enabling programmatic control of local Codex agents. This SDK allows developers to embed Codex's capabilities directly into their own programs, with a TypeScript library also available.
Python SDK Requirement
Python 3.10 or later
TypeScript Library Requirement
Node.js 18 or later
Sandbox Presets
`read_only`, `workspace_write`, `full_access`

The SDK provides an additional method to control Codex programmatically, complementing existing interfaces like the CLI, IDE extension, or Codex Web. For example, Cursor's Python SDK offers similar programmatic control for its agentic runtime.

Developers can use the Codex SDK to control agents within CI/CD pipelines, create custom agents that interact with Codex for complex engineering tasks, or integrate it into internal tools. Installation is done via pip install openai-codex, and sandbox presets allow control over filesystem access during execution.

Tibo
Tibo
@thsottiaux
X

You can use codex within your own programs using the Python SDK. It's awesome. Built by @ah20im and friends ``` pip install openai-codex ``` https://t.co/GjQVEPwtkF

83retweets1.4klikes
View on X

Still wondering? A few quick answers below.

The OpenAI Codex SDK is a Software Development Kit that allows developers to programmatically control Codex, an AI agentic coding tool. It enables integration of Codex's autonomous capabilities directly into other applications and workflows.

Developers can use the Codex SDK to integrate Codex into their CI/CD pipelines, build custom AI agents that interact with Codex for complex engineering tasks, or embed Codex's functionality within their own internal tools and applications.

The Codex SDK is available as a Python library, requiring Python 3.10 or later. There is also a TypeScript library for server-side use, which requires Node.js 18 or later.

The Python SDK can be installed using `pip install openai-codex`. The TypeScript library is installed via `npm install @openai/codex-sdk`. Both installations provide the necessary components to start controlling Codex programmatically.

Sandbox presets define the filesystem access permissions for a Codex agent during execution. Options include `read_only` for reading files without writing, `workspace_write` for reading and writing within the workspace, and `full_access` for no filesystem restrictions.

Every HeadsUpAI update is written based on its original source and reviewed before it's published. Read our editorial standards →

Share this update