CLI Tools
Claude Code
Connect through Anthropic Messages using the site root as the base URL.
The vendor documents custom endpoints. Check model capabilities and verify the connection.
On this page
Before you begin
Install the official Claude Code client. On Windows, follow its Git for Windows or WSL prerequisites. Choose a model with tool calling.
Have an A2Agent API key ready and copy an accessible model ID from the catalog. Replace every placeholder, back up existing settings and keep keys out of repositories.
Setup
File contents are usually shared; switching OS changes commands and paths. For WSL on Windows, select macOS / Linux.
01Install the client
Follow the installation instructions for your OS, then check claude --version. Update an existing installation first.
Open official documentation02Set the gateway and launch
In a new terminal, replace the key and model ID, then launch. Back up and clear conflicting ANTHROPIC_API_KEY, cloud-provider or login settings first.
Shellexport ANTHROPIC_BASE_URL='https://a2agent.me' export ANTHROPIC_AUTH_TOKEN='YOUR_A2AGENT_API_KEY' export ANTHROPIC_MODEL='YOUR_MODEL_ID' claude
Capabilities and limits
- Subagents and fast tasks may select other models. If a model is not found, check the default Haiku, Sonnet and Opus mappings.
- Messages compatibility does not imply support for every Claude server tool, cache or token-counting behavior.
Verify the connection
Replace every placeholder and run locally. Expect JSON containing OK. Then start a new client conversation, test one read-only tool call separately, and confirm the requests in A2Agent usage records. This test incurs a small amount of model usage.
curl --fail-with-body --silent --show-error --max-time 60 'https://a2agent.me/v1/messages' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_A2AGENT_API_KEY' \
-H 'anthropic-version: 2023-06-01' \
-d '{"model":"YOUR_MODEL_ID","max_tokens":128,"messages":[{"role":"user","content":"Reply with OK."}]}'Troubleshooting
If sign-in still appears, inspect this terminal’s environment and user settings.json for provider overrides.
401 / 403: authentication or access denied
Use a key issued by A2Agent, without extra spaces, and check that it is active and unexpired. Confirm the group permits the model and protocol. A vendor subscription credential cannot replace an A2Agent key.
404 / model not found: endpoint or model mismatch
Check the root URL, /v1 prefix and full request path against this guide; avoid duplicated paths. Model IDs are case-sensitive and must be accessible to the current key.
429: quota or rate limit
Check your balance, key limits, concurrent usage and service status. Wait before retrying and reduce simultaneous agents; repeated retries do not remove a quota limit.
Chat works, but tools fail or streaming stops
Test a short text request, then a single read-file tool call. Check tool support, output budget, proxy timeouts and client version. Inspect the diff before resuming a long task to avoid repeating actions.
Restore previous settings
Close this terminal to discard session variables. If saved in a shell profile or settings.json, remove the added fields and restore the previous model.
Sources and check date
Status is based on official configuration docs, not end-to-end client testing with A2Agent.
Docs checked 2026-09-18
