Aider
Use Aider with any of 221 models through Chuizi.AI via the OpenAI or Anthropic protocol.
Prerequisites
- Aider installed (
pip install aider-chat) - A Chuizi.AI account with an API key (starts with
ck-)
OpenAI Protocol (Recommended)
Use this configuration to access any model through the OpenAI-compatible endpoint.
Set the environment variables:
export OPENAI_API_BASE=https://api.chuizi.ai/v1 export OPENAI_API_KEY=ck-your-key-here
Then start Aider with your preferred model:
# Claude Sonnet aider --model openai/anthropic/claude-sonnet-4-6 # GPT-4.1 aider --model openai/openai/gpt-4.1 # DeepSeek aider --model openai/deepseek/deepseek-chat
Note: When using the OpenAI protocol, prefix the model name with openai/ to tell Aider to use the OpenAI API format, followed by the Chuizi.AI model name (e.g., openai/anthropic/claude-sonnet-4-6).
Anthropic Protocol
For Claude models, you can use the Anthropic native protocol for full feature compatibility:
export ANTHROPIC_API_BASE=https://api.chuizi.ai/anthropic export ANTHROPIC_API_KEY=ck-your-key-here
Then launch Aider:
aider --model anthropic/claude-sonnet-4-6
This uses the Anthropic Messages API directly, with no format conversion.
Configuration File
For a persistent setup, add configuration to ~/.aider.conf.yml:
# Using OpenAI protocol
openai-api-base: https://api.chuizi.ai/v1
openai-api-key: ck-your-key-here
model: openai/anthropic/claude-sonnet-4-6Or for the Anthropic protocol:
anthropic-api-key: ck-your-key-here
model: anthropic/claude-sonnet-4-6Set the ANTHROPIC_API_BASE environment variable separately since Aider's config file does not support it directly:
# Add to ~/.zshrc or ~/.bashrc export ANTHROPIC_API_BASE=https://api.chuizi.ai/anthropic
Verify the Setup
Run Aider and confirm it connects:
aider --model openai/anthropic/claude-sonnet-4-6
You should see Aider start and display the model name. Type a message to verify the model responds. Check app.chuizi.ai to confirm the request appears in your logs.
Recommended Models for Aider
| Model | Best For | Cost |
|---|---|---|
anthropic/claude-sonnet-4-6 | Best overall coding | Medium |
anthropic/claude-opus-4-6 | Complex refactoring | High |
openai/gpt-4.1 | General code editing | Medium |
deepseek/deepseek-chat | Budget-friendly coding | Low |
Troubleshooting
"Model not found" error
Ensure you use the correct model name format. When using OpenAI protocol, prefix with openai/ for Aider, then the Chuizi.AI model name: openai/anthropic/claude-sonnet-4-6.
Timeout errors
Aider defaults to a 60-second timeout. For complex requests with large models, increase it:
aider --model openai/anthropic/claude-sonnet-4-6 --timeout 120
Authentication errors
Verify your API key is set correctly and starts with ck-. Check that the environment variable name matches the protocol you are using (OPENAI_API_KEY for OpenAI protocol, ANTHROPIC_API_KEY for Anthropic protocol).
Next Steps
- Choose a Model — find the right model for your use case
- Cost Optimization — reduce costs with prompt caching and model selection
- Streaming Guide — understand how streaming works through the gateway