~/.codex/config.toml with Codex CLI/App. Use this page when you need to keep the official login, plugins, or Remote Control.
Key settings
Prerequisites
- Install the latest Codex VS Code Extension
- Complete the official login in the Extension or Codex App
- Create a BetterToken API Key
- Copy a Model ID from the model plaza or key Setup dialog
Install
Install the extension from the VS Code Marketplace, then restart VS Code.Manual setup
Configure the Extension
Edit~/.codex/config.toml:
requires_openai_auth = true preserves the official login. experimental_bearer_token authenticates BetterToken model requests. Do not write the BetterToken API Key to auth.json.Do not combine CLI/App and Extension authentication
Both alternatives use
[model_providers.custom]. Keep only one table in a TOML file.
Verify the connection
Create a new Extension session and send a short task. A response fromYOUR_MODEL_ID while plugins and Remote Control remain available confirms the setup.
Switch models
Changemodel and, optionally, review_model, then run Developer: Reload Window. Use a Model ID from the Setup dialog or model plaza.
Common errors
Advanced setup
Supported providers
Statuses apply to the BetterToken setup documented on this page.
What the setup methods mean
What the setup methods mean
- Manual setup: enter the API Key, Base URL, and Model.
- Not supported: no verified direct setup is currently available.
Related guides
- Codex CLI/App custom provider
- Preserve the official Codex login with a third-party API
- Codex config.toml setup guide
- What are model_provider, base_url, and wire_api?
Official references
Technical details
Why Extension authentication differs from CLI/App
Why Extension authentication differs from CLI/App
The Extension uses the official login for some Codex product features, so this setup keeps
requires_openai_auth = true. A pure CLI/App custom provider uses an environment variable and requires_openai_auth = false. Both send OpenAI Responses requests through https://bettertoken.ai/v1.
