Coding agents
Use TokenRex with OpenAI Codex
Use Codex CLI or its editor extension through a TokenRex custom provider.
Before you start
- Codex CLI or the Codex editor extension
- A TokenRex API key saved as TOKENBAZAR_API_KEY
Step-by-step setup
- 1
Install Codex with npm install -g @openai/codex.
- 2
Save your TokenRex key in the TOKENBAZAR_API_KEY environment variable.
- 3
Open ~/.codex/config.toml and add the configuration below.
- 4
Keep wire_api set to responses and use the exact provider name tokenbaazar in both places.
- 5
Open your project folder and run codex, or select the same provider in the Codex editor extension.
Configuration
toml
# ~/.codex/config.toml
model = "openai/gpt-6-astra"
model_provider = "tokenbaazar"
[model_providers.tokenbaazar]
name = "TokenRex"
base_url = "https://tokenrex.ai/api/public/v1"
env_key = "TOKENBAZAR_API_KEY"
wire_api = "responses"Verify the connection
Ask Codex a simple repository question and confirm the GPT model request appears in your Dashboard.