Prerequisites
- Claude Code installed (see Step 1 if you haven’t installed it yet)
- An A2Agent API key — sign up at a2agent.me/register to get one
Setup
Locate or create the config file
Claude Code reads environment and permission settings from
~/.claude/settings.json. Create the file if it doesn’t exist:Add the A2Agent configuration
Open
~/.claude/settings.json in your editor and paste the following, replacing the placeholder with your actual A2Agent key:~/.claude/settings.json
ANTHROPIC_AUTH_TOKEN must be your A2Agent API key — not a key from Anthropic. A2Agent accepts requests in the Anthropic API format and handles routing to the underlying model for you.Recommended models
For coding tasks, these A2Agent models deliver the best results:| Model | Best for |
|---|---|
deepseek-v4-pro | Complex refactoring and architecture |
glm-5.1 | General-purpose coding assistance |
kimi-k2.7-code | Code generation and debugging |
minimax-m2.5 | Long-context code analysis |
Troubleshooting
401 Unauthorized
401 Unauthorized
Connection refused or network error
Connection refused or network error
Verify that
ANTHROPIC_BASE_URL is set to exactly https://api.a2agent.me — no trailing slash, no extra path segments. Any deviation will cause the connection to fail.Model not found
Model not found
If you are specifying a model explicitly, the model name must match an A2Agent model ID exactly — for example,
deepseek-v4-pro, kimi-k2.7-code, glm-5.1, or minimax-m2.5. Check the A2Agent model list for the full catalogue of available IDs.Config changes not taking effect
Config changes not taking effect
Claude Code reads
~/.claude/settings.json at startup. If you edited the file while Claude Code was already running, quit and relaunch it for the new settings to take effect.