OpenAI Codex CLI Integration
OpenAI Codex (or @openai/codex) is a powerful CLI utility that enables automated file editing, code generation, and project management directly from your terminal.
By routing Codex through KoboiLLM, you can leverage any supported model with real-time usage monitoring and local payment processing.
Step 1: Install OpenAI Codex CLI
Ensure Node.js and npm/yarn are installed on your machine, then install the Codex CLI globally:
npm install -g @openai/codexStep 2: Configure Environment Variables
Codex reads standard OpenAI environment variables. Export the following parameters in your terminal session:
Linux / macOS (Bash/Zsh):
# Point base URL to KoboiLLM gatewayexport OPENAI_BASE_URL="https://api.koboillm.com/v1"
# Set your secret KoboiLLM keyexport OPENAI_API_KEY="sk-x...env:OPENAI_BASE_URL="https://api.koboillm.com/v1"$env:OPENAI_API_KEY="sk-x...## Step 3: Run Codex with KoboiLLM
Launch Codex CLI with your selected model:
```bash# Using GPT-4ocodex --model openai/gpt-4o
# Using Claude 3.5 Sonnetcodex --model anthropic/claude-3-5-sonnet