API documentationInstall and configure Codex
Install and configure Codex
Configure a custom Responses API provider for the Codex CLI.
npm
This installation uses npm. For native installers and Windows setup, start with the official Codex CLI guide.
npm install -g @openai/codex
codex --versionConfigure TokenPilot
Set TOKENPILOT_API_KEY and add the provider to your user-level config, ~/.codex/config.toml. If it already has a model or model_provider setting, update those entries instead of duplicating them.
model_provider = "tokenpilot"
model = "REPLACE_WITH_MODEL_ID"
[model_providers.tokenpilot]
name = "TokenPilot"
base_url = "https://api.tokentpilot.com/v1"
env_key = "TOKENPILOT_API_KEY"
wire_api = "responses"Verify the connection
Run codex in your project, check /status, and try a short prompt. The model must support Responses. If the app cannot find the key, start the CLI from the same terminal where you set it.
codex