Requirements
The Codex TypeScript SDK requires:- Node.js 18 or higher
- The
@openai/codexCLI installed and available in your PATH
Install the SDK
Install the SDK using your preferred package manager:Verify Installation
Create a simple test script to verify the SDK is installed correctly:test.ts
Environment Setup
API Configuration
The SDK requires access to the Codex API. Configure your credentials:TypeScript Configuration
Ensure yourtsconfig.json is configured for ES modules:
tsconfig.json
The SDK uses ES module syntax (
import/export). Ensure your project is configured to support ES modules.Package Information
The SDK is published as@openai/codex-sdk with the following characteristics:
@openai/codex-sdkES Module (
.js files with import/export)./dist/index.js./dist/index.d.tsApache-2.0
Troubleshooting
Module Not Found Error
Module Not Found Error
Ensure you’ve installed the package and that your
node_modules is up to date:Codex CLI Not Found
Codex CLI Not Found
The SDK requires the Or specify a custom path when creating the client:
codex CLI to be installed. Install it globally:Node.js Version Error
Node.js Version Error
Next Steps
Usage Guide
Learn how to use the SDK with code examples and detailed API documentation