Claude Code is Anthropic's command-line coding agent: it reads your code, edits files, runs shell commands, and commits to Git from the terminal. It suits engineers who work in the terminal and want an agent that operates directly on the local repo. It talks the Anthropic Messages protocol (/v1/messages).
base_url or *_BASE_URL setting.GET /v1/models.Skip it — one-line setup
The script installs Claude Code from its official source, writes the gateway settings into the
tool's own config file (backing up any existing one) and runs a live check. It asks for your gateway key, or
take it from --key / --key-file. --uninstall restores exactly what it wrote.
curl -fsSL https://quantoport.com/agents/claude-code/setup | bash -s claude-code
1 · Install
Install Claude Code from its own official source.
curl -fsSL https://claude.ai/install.sh | bash # or via npm: npm install -g @anthropic-ai/claude-code # Windows (PowerShell): irm https://claude.ai/install.ps1 | iex
2 · Configure — point it at QuantoPort
Gateway base URL https://quantoport.com; get your key from the console.
International site https://quantoport.com (native Anthropic format, supported directly):
1) Set environment variables:
export ANTHROPIC_BASE_URL=https://quantoport.com
export ANTHROPIC_AUTH_TOKEN=<your gateway key>
(if your gateway reads x-api-key instead, use export ANTHROPIC_API_KEY=<your gateway key>)
2) Or add an env block to ~/.claude/settings.json (more reliable for background agents):
{ "env": { "ANTHROPIC_BASE_URL": "https://quantoport.com", "ANTHROPIC_AUTH_TOKEN": "<your gateway key>" } }
3) Run claude and check /status: the "Anthropic base URL" line should show the gateway.
CN site https://api.shinlinkai.com exposes only the OpenAI format, while Claude Code requires the Anthropic /v1/messages protocol; it needs protocol conversion and is not supported yet.3 · Verify
One request proves you are on our channel.
curl -sS -w '\n%{http_code}\n' -X POST "$ANTHROPIC_BASE_URL/v1/messages" -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" -H "anthropic-version: 2023-06-01" -H "content-type: application/json" -d '{"model":"claude-sonnet-4-6","max_tokens":1,"messages":[{"role":"user","content":"."}]}'
# A JSON body starting with {"id":"msg_ means the gateway is reachable; or just run: claude -p "hello"4 · Common pitfalls
ANTHROPIC_AUTH_TOKENis sent as Authorization: Bearer;ANTHROPIC_API_KEYis sent as x-api-key — using the wrong one returns 401.- A
settings.jsonenv block overrides shell exports; prefer it for background agents. - The gateway credential overrides a saved
claude.ailogin; confirm with/statusand run/logoutif needed. - On Windows set $env:
ANTHROPIC_BASE_URL="..."; use the model names your gateway actually serves.
Sources for the tool-side steps: docs.claude.com/en/docs/claude-code/setup docs.claude.com/en/docs/claude-code/llm-gateway-connect docs.claude.com/en/docs/claude-code/settings