Codex CLI Integration
OpenAI Codex CLI is a powerful AI programming assistant. With Fizzly API, you can flexibly use various models.
Configuration
Set Environment Variables
# Linux/macOS
export OPENAI_API_KEY=your-fizzly-api-key
export OPENAI_BASE_URL=https://api.fizzly.com/v1
# Windows (PowerShell)
$env:OPENAI_API_KEY="your-fizzly-api-key"
$env:OPENAI_BASE_URL="https://api.fizzly.com/v1"Persistent Configuration
Add to your shell configuration file:
Bash (~/.bashrc)
export OPENAI_API_KEY=your-fizzly-api-key
export OPENAI_BASE_URL=https://api.fizzly.com/v1Zsh (~/.zshrc)
export OPENAI_API_KEY=your-fizzly-api-key
export OPENAI_BASE_URL=https://api.fizzly.com/v1PowerShell ($PROFILE)
$env:OPENAI_API_KEY="your-fizzly-api-key"
$env:OPENAI_BASE_URL="https://api.fizzly.com/v1"Usage
After configuration, use Codex CLI normally:
# Start Codex
codex
# Specify model
codex --model gpt-4oAvailable Models
| Model | Description | Recommended For |
|---|---|---|
gpt-4o | GPT-4o, multimodal | General programming |
gpt-4-turbo | GPT-4 Turbo | Complex tasks |
claude-3-5-sonnet-20241022 | Claude 3.5 Sonnet | Code generation |
deepseek-chat | DeepSeek V3 | Cost-effective |
Recommended Setup
For daily programming tasks, we recommend gpt-4o or claude-3-5-sonnet-20241022 for excellent code understanding and generation.
Switching Models
Use model mapping to quickly switch between models for different tasks:
# Use GPT-4o for code generation
codex --model gpt-4o "Write a quicksort algorithm"
# Use Claude for code review
codex --model claude-3-5-sonnet-20241022 "Review this code for security issues"Troubleshooting
Invalid API Key
Ensure your API Key starts with sk- and is enabled in the Fizzly console.
Model Request Failed
- Check model name spelling
- Verify account balance
- See Error Handling for detailed error info