Connect Claude Code to VisionCoder: base URL and API key setup

Claude Code connects to the VisionCoder gateway over the Anthropic protocol: set the gateway address, API key and model name, with copyable config, a verification command and common errors; 10 public models are available now, such as claude-fable-5, claude-fable-5-1, claude-fable-5-2.

Home / Setup guides / Claude Code

Protocol: Anthropic; checked 2026-11-10; 10 models available

Notice: Anthropic's documentation states that routing Claude Code to non-Claude models through any gateway is not supported. The table lists the models here that declare the Anthropic protocol; non-Claude models may run into compatibility problems, so judge for yourself.

Note: Once a gateway credential variable is set, it takes precedence over a saved claude.ai login, which stays saved but unused. The gateway accepts both Authorization: Bearer (ANTHROPIC_AUTH_TOKEN) and x-api-key (ANTHROPIC_API_KEY), so use either one.

Requirements

Claude Code speaks the Anthropic protocol (/v1/messages). The gateway does not convert protocols, so only models that declare it work. The wrong protocol returns 400 with the path to use instead.

Before you start: API key and gateway address

Create a key and look up the gateway address on the API Keys page after signing in; below it appears as the placeholder <gateway-host>. Personal keys start with sk-u-, employee keys with sk-e-, organization tokens with sk-org-; all of them can call models. Management keys (sk-mgmt-) are rejected.

Setup steps

  1. Sign in, create a key on the API Keys page and look up the gateway address.
  2. Set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN in your terminal. The gateway address has no /v1: Claude Code appends /v1/messages itself.
  3. Send a request with the verification command below to confirm the gateway and key work before you open Claude Code.
  4. Pick a model name from the table below with ANTHROPIC_MODEL (or use claude --model <name>, or /model <name> inside a session).
  5. Run claude in the same terminal and type /status. The Anthropic base URL line must show your gateway address; if the line is missing, the variable did not reach the session.
  6. To make it permanent, put the variables in the env block of ~/.claude/settings.json. Never put the key in a project's .claude/settings.json: it is committed and shared with everyone who clones the repository.

Shell environment variables (Bash / Zsh)

export ANTHROPIC_BASE_URL=https://<gateway-host>
export ANTHROPIC_AUTH_TOKEN=sk-...
export ANTHROPIC_MODEL=<model-name>

In ~/.claude/settings.json

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://<gateway-host>",
    "ANTHROPIC_AUTH_TOKEN": "sk-...",
    "ANTHROPIC_MODEL": "<model-name>"
  }
}

Verify with curl

Replace the model name with one from the table below; a JSON response means the gateway and key work.

curl https://<gateway-host>/v1/messages \
  -H "x-api-key: sk-..." \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"<model-name>","max_tokens":1024,"messages":[{"role":"user","content":"Hello"}]}'

Available models

Only public models that declare the Anthropic protocol. Open a model for full pricing. Unit: CNY per million tokens.

ModelVendorRegionContextInput / output
claude-fable-5Anthropicoverseas1.25M¥20.00 / ¥100.00
claude-fable-5-1Anthropicoverseas1.25M¥20.00 / ¥100.00
claude-fable-5-2Anthropicoverseas1.25M¥16.00 / ¥80.00
claude-haiku-5-5Anthropicoverseas1.25M¥0.60 / ¥3.00
claude-opus-4-7Anthropicoverseas1.25M¥10.00 / ¥50.00
claude-opus-4-8Anthropicoverseas1.25M¥10.00 / ¥50.00
claude-opus-5Anthropicoverseas1.25M¥10.00 / ¥50.00
claude-opus-5-5Anthropicoverseas1M¥8.00 / ¥40.00
claude-sonnet-5Anthropicoverseas1.25M¥4.00 / ¥20.00
claude-sonnet-5-5Anthropicoverseas1.25M¥4.00 / ¥20.00

Troubleshooting

SymptomCause and fixSource
401, key rejectedFirst confirm the key was created on VisionCoder and is still active. The request is also rejected when Authorization is not in the Bearer <key> form, or when Authorization and x-api-key carry different values. (error code 401060)Official docs + gateway
400, Extra inputs are not permittedOfficial fix: set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 to suppress the experimental fields, then retry.Official docs
Claude Code asks you to log in although the curl test succeedsSet the credential variable where Claude Code reads it before first-run setup: a shell export or the env block of ~/.claude/settings.json. A project's .claude/settings.json only applies after the first-run wizard and trust prompt.Official docs
`ANTHROPIC_API_KEY` is set but ignored, with no promptPer the documentation, the key needs a one-time approval in interactive sessions, and a previously declined key is ignored without asking again. Enable it under /config with the Use custom API key option.Official docs
Connection refused or host cannot be resolvedThe gateway address is wrong, or a firewall or VPN blocks the path to it. Run the verification command below; it fails immediately for the same reason.Official docs
400, model does not support this endpointThe model does not declare the Anthropic protocol; the response lists the paths it does support. Use only models from the table. (error code 400159)Gateway
404, model not foundThe model name is misspelled or does not exist. Use the exact name from the table. (error code 404042)Gateway
403, model unavailableThe model exists, but the workspace of your key cannot call it. (error code 403060)Gateway
The error message starts with [402070] or [402072]: insufficient or used-up creditThe account has no usable credit; buy a plan or a top-up pack first, or ask your administrator if you belong to a company. Tools show different HTTP status codes for this error, so go by the error number at the start of the message. (error code 402070, 402072)Gateway
The error message starts with [402073]: the plan has expiredThe plan has expired; buy a plan or a top-up pack, or ask your administrator if you belong to a company. (error code 402073)Gateway
The error message starts with [402074]: the monthly usage cap is reachedThe company token has reached its monthly usage cap; ask the company administrator. (error code 402074)Gateway
429, rate limitedToo many requests or too many in flight; retry later or wait for the current requests to finish. (error code 429000, 429060, 429062, 429063)Gateway
The error message starts with [503060]: no healthy channelThe model has no healthy channel right now; retry later. Tools show different HTTP status codes for this error, so go by the error number at the start of the message. (error code 503060)Gateway

Official sources

Checked 2026-11-10. Unofficial guide: VisionCoder is not affiliated with the owners of Claude Code, whose name and trademarks belong to them. The steps follow its official documentation and may differ after tool updates; the official documentation prevails.

Other tools

中文