Documentation Index
Fetch the complete documentation index at: https://docs.agipower.ai/llms.txt
Use this file to discover all available pages before exploring further.
Guide to Using Codex CLI with AGIPower
Codex CLI is an open-source programming assistant from OpenAI that runs in your local terminal. It can read, modify, and run code within a directory you choose. Built with Rust, it is fast and efficient, and is continuously improved on GitHub. By integrating with AGIPower, you gain access to more model options instead of being limited to the official OpenAI API.OpenAI has explicitly positioned Responses as the next-generation unified interface. Chat Completions is still available, but it is no longer the preferred choice for new projects. Codex will follow this direction as well—treating Chat Completions as a compatibility option and gradually migrating to Responses (the configuration in this article uses Responses).Note the OpenAI-compatible setting: base_url=“https://api.agipower.ai/v1”.
Configuration Options
Install Codex CLI
npm/pnpm
Configure Environment Variables
Add your AGIPower API Key to your shell configuration file:Configure Codex
Create or modify the Codex configuration file~/.codex/config.toml:
Start Using It Immediately
After configuration, reload your shell configuration and start Codex:Supported Models
You can freely switch themodel field in config.toml to any model supported by AGIPower.
- View models available under the Responses protocol via the AGIPower model list
- Use the model slug (e.g.,
openai/gpt-5.2-codex) - To target a specific provider, see the Provider Routing documentation
| # | Model slug | Highlights |
|---|---|---|
| 1 | openai/gpt-5.2-codex | Coding-optimized |
| 2 | openai/gpt-5.2 | Strong general capability |
| 3 | anthropic/claude-sonnet-4.5 | Excellent reasoning |
| 4 | anthropic/claude-opus-4.1 | Complex tasks |
| 5 | google/gemini-2.5-pro | Multimodal support |
| 6 | x-ai/grok-code-fast-1 | Fast responses |
| 7 | x-ai/grok-4-fast | Efficient coding |
| 8 | deepseek/deepseek-chat | Cost-effective |
| 9 | qwen/qwen3-coder-plus | Chinese-friendly coding |
| 10 | moonshotai/kimi-k2-0905 | Long-context support |
| 11 | z-ai/glm-4.6 | Balanced overall |
| 12 | inclusionai/ring-1t | Strong reasoning |
Responses-Compatible Models (Fetched on 2026-01-29)
The list below is fetched from the AGIPower model list (Responses filter). Use that link for the latest updates.Model slug list (Responses)
Troubleshooting
Common Issues
API Key Error
Issue: You are told the API Key is invalid or unauthorized. Solutions:- Check whether the environment variable
AGIPower_API_KEYis set correctly - Use
echo $AGIPower_API_KEYto verify the environment variable value - Confirm the API Key is active and that you have sufficient balance
- Verify the API Key format starts with
sk-
Connection Failure
Issue: Codex CLI cannot connect to the AGIPower service. Solutions:- Check that your network connection is working
- Verify that
base_urlinconfig.tomlis correctly set tohttps://api.agipower.ai/v1 - Confirm your firewall settings are not blocking outbound connections
- Try
curl https://api.agipower.ai/v1/modelsto test connectivity
Environment Variable Not Taking Effect
Issue: Even after setting the API Key, it still says it is not configured. Solutions:- Reopen the terminal window, or run
source ~/.zshrcorsource ~/.bashrcto reload the configuration - Confirm the environment variable is set correctly:
echo $AGIPower_API_KEY - Make sure you added it to the correct shell configuration file (
.zshrcfor zsh,.bashrcfor bash)
Configuration File Path Issue
Issue: Changes to the configuration file do not take effect. Solutions:- Confirm the configuration file path is
~/.codex/config.toml - If the directory does not exist, create it first:
mkdir -p ~/.codex - Check that the configuration file syntax is correct (TOML format)
- Use
cat ~/.codex/config.tomlto verify the file contents
Model Unavailable
Issue: A model is reported as unavailable or unsupported. Solutions:- Visit the AGIPower model list to confirm the model is available
- Check that the model slug is spelled correctly
- Try another recommended model to test
- Confirm your account has permission to access the model
Advanced Configuration
Configure Models of Different Sizes
You can switch between different model sizes inconfig.toml based on your task requirements:
Balanced Setup
Performance-First Setup
Cost-Optimized Setup