SesameSesame

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

FeatureDetails
ProviderOpenAI
CLI Toolcodex
Auth MethodsAPI 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:

  1. Enable device code auth in ChatGPT security settings

Option A: Sign in directly (recommended)

  1. Go to Settings → Agent Credentials → Codex → Subscription tab
  2. Click Sign in with OpenAI Codex
  3. Enter the device code shown on the OpenAI verification page
  4. Sesame handles the rest automatically

Option B: Enter tokens manually

If you already have tokens (e.g., from running the CLI locally):

  1. Run codex login --device-auth in your terminal
  2. Complete the authentication flow in your browser
  3. Copy the contents of ~/.codex/auth.json
  4. In Sesame: Agent Credentials → Codex → Subscription tab → paste below the "or enter token manually" divider

API Key

  1. Get an API key from OpenAI Platform
  2. Add to Sesame:
    • UI: Agent Credentials → Codex → OpenAI API Key tab
    • Environment variable: Set OPENAI_API_KEY

Environment Variables

VariableDescription
OPENAI_API_KEYAPI 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-auth on 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

  1. Go to ChatGPT security settings
  2. Ensure "Device code authentication" is enabled
  3. Try logging out and back in to ChatGPT
  4. Re-run codex login --device-auth on 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.

On this page