Codex CLI
Codex CLI can use OpenAI-compatible endpoints. The essential DDTokens settings are the API key, Base URL, and model name.
Prerequisites
- Codex CLI is installed.
- You have created a DDTokens API key.
- Your account can call OpenAI-compatible models.
Configuration
Configuration varies between Codex CLI versions. Prefer the OpenAI-compatible settings supported by your current version:
bash
export OPENAI_API_KEY="$DDDT_API_KEY"
export OPENAI_BASE_URL="https://apiddt.com/v1"If your version uses OPENAI_API_BASE, you can also set:
bash
export OPENAI_API_BASE="https://apiddt.com/v1"Select a Model
Start with a lightweight model to verify the connection:
text
gpt-4o-miniAfter the call succeeds, switch to a stronger model or one better suited to coding tasks.
Verify
Run a simple task in a test directory:
bash
codex "explain what this project does"If the command fails, check:
- The Base URL includes
/v1. - The API key is valid.
- The model name is available in the DDTokens dashboard.
- Your Codex CLI version supports custom OpenAI-compatible endpoints.