Codex
OpenAI's Codex agent for AI-assisted coding
Codex is OpenAI's coding agent, powered by GPT models. It's fast, capable, and integrates well with the OpenAI ecosystem.
Overview
| Feature | Details |
|---|---|
| Provider | OpenAI |
| CLI Tool | codex |
| Auth Methods | API key, ChatGPT Plus/Pro subscription |
Sesame automatically downloads and caches the Codex CLI binary when a session starts. You do not need to install it manually.
Authentication
Codex has two tabs in the Agent Credentials dialog: Subscription and OpenAI API Key.
Subscription (ChatGPT Plus/Pro)
Use your ChatGPT Plus or ChatGPT Pro subscription:
- Enable device code auth in ChatGPT security settings
Option A: Sign in directly (recommended)
- Go to Settings → Agent Credentials → Codex → Subscription tab
- Click Sign in with OpenAI Codex
- Enter the device code shown on the OpenAI verification page
- Sesame handles the rest automatically
Option B: Enter tokens manually
If you already have tokens (e.g., from running the CLI locally):
- Run
codex login --device-authin your terminal - Complete the authentication flow in your browser
- Copy the contents of
~/.codex/auth.json - In Sesame: Agent Credentials → Codex → Subscription tab → paste below the "or enter token manually" divider
API Key
- Get an API key from OpenAI Platform
- Add to Sesame:
- UI: Agent Credentials → Codex → OpenAI API Key tab
- Environment variable: Set
OPENAI_API_KEY
Environment Variables
| Variable | Description |
|---|---|
OPENAI_API_KEY | API key for OpenAI |
Troubleshooting
"Authentication failed"
- API key: Verify at OpenAI Platform
- Subscription: Ensure device code auth is enabled in ChatGPT settings
- Re-obtain tokens using
codex login --device-authon your local machine
"Rate limited"
- API has rate limits based on your tier
- Subscription users check usage dashboard
- Wait and retry, or upgrade your plan
"Context length exceeded"
- GPT-4 has 128K token context
- For very large codebases, focus on specific files
- Use targeted prompts
Device auth not working
- Go to ChatGPT security settings
- Ensure "Device code authentication" is enabled
- Try logging out and back in to ChatGPT
- Re-run
codex login --device-authon your local machine
Bootstrap failed
If the agent binary fails to download:
- Check that the sandbox has internet access
- Verify network/firewall rules allow HTTPS to
github.com - Check the session logs for specific download errors
Pricing
For current pricing, see OpenAI Pricing.