In short.
The Codex SDK guide is a practical reference for developers adding Codex to applications or CI jobs, but authentication steps and prices are unspecified. It explains installation, creating and resuming conversations, asynchronous use, model selection and filesystem permissions. TypeScript requires server-side Node.js 18 or later; Python requires Python 3.10 or later and published builds include a pinned Codex runtime dependency. Python-specific guidance covers external tool content, history retrieval and service tiers. The examples were not executed, and reliability, performance and deployment readiness remain unassessed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes the complete selected page at https://learn.chatgpt.com/docs/codex-sdk.md: TypeScript and Python installation and usage, configuration precedence, external messages, history controls, service tiers, sandbox presets and compatibility notices. The MCP removal notice and references to the app server and Security SDK are included as statements on that page. Linked pages, repository files, package contents and pricing details are excluded. No code was executed; behavior, performance, security properties and production suitability remain untested.
The overview
Identity
This documentation page explains programmatic control of Codex through the TypeScript package @openai/codex-sdk and the Python package openai-codex. Its original address is [https://learn.chatgpt.com/docs/codex-sdk.md]. The resource is the guide itself; the linked SDK repositories and other documentation pages are outside its assessed scope.
Assessment
The guide provides a concrete starting point for connecting application code to Codex: it names packages, gives installation commands and demonstrates the main conversation lifecycle. Its permission and runtime details also help experienced developers identify integration constraints.
It supports an initial implementation, but does not establish whether a particular CI deployment will be reliable or economical. Authentication instructions, failure handling and measured results are absent.
Users
The stated audiences include developers automating CI/CD work, building engineering agents, creating internal tools and integrating Codex into applications. TypeScript users need a server-side environment; Python users can choose synchronous or asynchronous interfaces.
The examples assume familiarity with package installation and basic programming. Beginners can follow the short call sequences, while deployment and account configuration require knowledge beyond this page.
Capabilities
The TypeScript examples create a local conversation thread, submit prompts, retrieve a final response, continue the same conversation and resume it by ID. Thread options include model, reasoning effort, sandbox mode and a threadSource label that survives resumption.
The Python guidance adds ExternalMessage for content supplied by tools or other agents, resumption or forking without returning old turns, later history retrieval and service-tier controls. It also shows changing filesystem permissions between turns. These features are documented capabilities, not observed test results.
Using it
Requirements
The TypeScript library requires server-side Node.js 18 or later. The Python library requires Python 3.10 or later. Published Python SDK builds include a pinned Codex CLI runtime dependency, so a separately chosen executable is an optional override.
The examples name gpt-6.1-sol, which must be available to the signed-in account. The page says to omit the model setting to use the configured default instead. It does not explain authentication or establish plan eligibility.
When supplying a custom executable, ExternalMessage, explicit include_turns on resume or fork, and turn_service_tier require Codex CLI 0.151.0 or later. For CLI 0.166.0 or later, the page instructs users to resume with the thread's saved model provider and fork the thread when switching providers.
Mechanism
A thread holds the context for successive coding requests. Applications create or resume a thread, submit a prompt and read its result. The TypeScript interface is asynchronous. The Python SDK controls a local Codex app-server through JSON-RPC and offers Codex and AsyncCodex interfaces.
TypeScript configuration can combine structured config with raw TOML configOverrides. Raw overrides take precedence over structured config; SDK-managed settings and thread-specific options are applied afterward and take precedence over both. These overrides do not edit Codex configuration files.
Python sandbox presets allow read-only access, writes within the workspace and configured writable roots, or unrestricted filesystem access. A sandbox supplied for a turn also applies to later turns until changed. ExternalMessage identifies externally supplied content as lower-priority tool output.
Setup
For TypeScript, the documented installation command is npm install @openai/codex-sdk. Import Codex, create a client, call startThread() and await thread.run() within asynchronous application code.
For Python, the documented command is pip install openai-codex, which installs the latest stable release according to the page. Instantiate Codex inside a context manager, call thread_start() and then thread.run(). AsyncCodex supports applications already using asyncio. The guide does not provide the sign-in or credential setup needed before a successful request.
Example
The guide demonstrates a CI repair workflow: ask Codex to plan how to diagnose failing CI, then call run() again on the same thread to request implementation. A stored thread ID lets the application resume that conversation later.
TypeScript reads the response through result.finalResponse; Python uses result.final_response. Another Python example requests a change with workspace-write permissions and then switches to read-only permissions for a diff review. None of these examples was executed.
Assessment & evidence
Limitations
The guide does not document a complete authentication flow, CI credential configuration, retry policy, concurrency behavior or deployment packaging. It also does not specify data transmission, retention or the full boundaries of sandbox enforcement.
No execution results, benchmarks or comparative evaluations are supplied. Coding accuracy, latency, operational reliability and resistance to malicious external content remain unassessed. The page documents input priority for ExternalMessage without demonstrating a security guarantee.
Reasoning
The guide's practical value follows from its concrete integration controls: persistent threads support multi-step work, asynchronous interfaces fit application code, and explicit filesystem settings let callers distinguish editing from review. These are reasons to consider the integration, not evidence of measured productivity gains.
The TypeScript examples set modelReasoningEffort to low, but the page does not explain available effort levels or their quality, latency and cost tradeoffs. It does not establish that this example setting suits every coding task.
Alternatives
For custom clients handling authentication, conversation history, approvals and streamed events, the page directs developers to the Codex app server [https://learn.chatgpt.com/docs/app-server]. It also names the CLI, IDE extension and Codex cloud as other ways to use Codex.
For structured repository or change scans with security findings and coverage, it points beta users to the Codex Security TypeScript SDK [https://learn.chatgpt.com/docs/security/sdk]. These alternatives were not independently assessed. The removed codex mcp-server command and codex-mcp-server binary are historical integration paths, not current alternatives.
Evidence
The sole source is the complete documentation page at [https://learn.chatgpt.com/docs/codex-sdk.md]. Its captured source revision is sha256:c4b05ba2e36aa7aeef39710a2cdf739f5b485acc806fcb177c952ec9b73576fc.
The evidence establishes what the page documents, including package names, API examples and stated runtime requirements. Linked repositories, pricing information and related guides were not inspected. No package installation, SDK execution or generated-code validation occurred.
Access & freshness
Costs
Package charges, subscription requirements, model usage rates and total operating costs are unknown from this page. Its pricing link concerns model availability, but the destination was not assessed.
Python exposes service_tier for ongoing settings and turn_service_tier for one new turn. The page describes the default tier as standard speed, without providing prices or measured speed differences. Installation commands do not establish that model usage is free.
Rights
The page supplies no licence text for the documentation, SDK packages or bundled runtime. Commercial-use rights, redistribution permission and terms governing generated code are unknown from this evidence. Links to source repositories do not establish those permissions.
Freshness
The page was captured on 23 November 2026 at 02:18:24.503 UTC. No publication date, last-updated date or exact SDK package release number is stated.
At capture, the page described Python as stable, offered pip install --pre openai-codex for prereleases and reported removal of the legacy MCP entry points in favor of the app server. Current package availability and changes after that capture are unknown.
Actions
Choose the language that fits the host application, confirm its runtime requirement and establish account access, authentication and billing before planning an unattended integration. If overriding Python's pinned executable, check compatibility with the specific features required.
Use a small disposable repository to evaluate a prompt, thread resumption, error handling and filesystem permissions before connecting production CI. Start with read-only access for review work and explicitly configure workspace writes for editing. For externally supplied issue or tool content in Python, follow the documented ExternalMessage input pattern.
Consult the linked SDK repositories for implementation detail and the app-server documentation if the application needs custom approval handling or streamed events. Those pages require separate assessment.
