Run Claude Code on a Relay Endpoint: Setup, the Model-Catalog Pitfall, and What It Actually Costs
Most AI coding tools speak one of two dialects: the OpenAI chat-completions format, or Anthropic's Messages format. If you want to run those tools against a third-party relay endpoint instead of a first-party account — for cost reasons, payment reasons, or because one key should cover several model families — the setup is short. The part that wastes people's time is a catalog mismatch that produces a confusing model_not_found error. This guide covers the configuration, that pitfall, and a cost breakdown with real listed prices, using one relay (ZeroShell, which I operate — disclosure at the end) as the worked example. The steps generalize to any OpenAI-compatible relay. The two endpoints you need to know A relay typically exposes: POST /v1/chat/completions — the OpenAI-compatible endpoint. Base URL form: https://zeroshell.top/v1. POST /v1/messages — the Anthropic-native endpoint. This is the one Claude Code actually requires. That second endpoint is the real compatibi
Most AI coding tools speak one of two dialects: the OpenAI chat-completions format, or Anthropic's Messages format. If you want to run those tools against a third-party relay endpoint instead of a first-party account — for cost reasons, payment reasons, or because one key should cover several model families — the setup is short. The part that wastes people's time is a catalog mismatch that produces a confusing model_not_found error. This guide covers the configuration, that pitfall, and a cost breakdown with real listed prices, using one relay (ZeroShell, which I operate — disclosure at the end) as the worked example. The steps generalize to any OpenAI-compatible relay.
The two endpoints you need to know
A relay typically exposes:
-
POST /v1/chat/completions— the OpenAI-compatible endpoint. Base URL form:https://zeroshell.top/v1. -
POST /v1/messages— the Anthropic-native endpoint. This is the one Claude Code actually requires.
That second endpoint is the real compatibility test. Plenty of relays advertise "Claude support" but only translate OpenAI-format requests; Claude Code sends Anthropic-format requests and fails against those. Before paying anything, verify the relay documents and serves /v1/messages. On ZeroShell both formats are served, and both have been exercised with live requests — Claude models respond over the OpenAI format and over /v1/messages.
Claude Code configuration
Claude Code reads its endpoint from environment variables:
export ANTHROPIC_BASE_URL=https://zeroshell.top
export ANTHROPIC_API_KEY=
claude
Note the base URL has no /v1 suffix here — Claude Code appends /v1/messages itself. Model names come from the relay's own catalog, for example claude-sonnet-4-5, so copy them from the relay's model list rather than typing from memory; a wrong suffix is the most common self-inflicted error.
The pitfall: one account, several catalogs
Here is the part most relay documentation glosses over. On ZeroShell, an API key belongs to a group, and each group has its own model catalog:
- A low-cost group key sees 27 models: DeepSeek, GLM, GPT, Grok, Kimi, and Qwen families. No Claude models at all.
- An official group key sees 22 models, including the full Claude lineup.
The site advertises 46 models — that figure is the aggregate across all groups, not what any single key can call. If you create a low-cost key and point Claude Code at it, every request returns model_not_found, and the error message blames the model rather than your key's group. The fix takes thirty seconds (create a key in the correct group), but only once you know groups exist. One account can hold keys in several groups, and the balance is shared, so the practical setup is: an official-group key for Claude Code, a low-cost key for bulk OpenAI-format work.
When evaluating any relay, ask this question first: is the advertised model count per-key or per-account? The answer determines whether your first integration attempt works.
Other OpenAI-compatible tools
For tools like Continue, Aider (in OpenAI mode), or chat clients such as Cherry Studio and NextChat, configuration is the standard trio:
- Base URL:
https://zeroshell.top/v1 - API key: a key from the group that contains your model
- Model: the exact catalog name, copied, not recalled
A 30-second smoke test before wiring up any tool:
curl https://zeroshell.top/v1/chat/completions \
-H "Authorization: Bearer " \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5-mini","messages":[{"role":"user","content":"ping"}]}'
If this returns a completion, every OpenAI-compatible client will work. If it returns a model error, suspect the group/catalog mismatch above before suspecting the endpoint.
What it costs
Relay pricing is per million tokens, published on the pricing page. Current listed prices:
| Model | Input / 1M | Output / 1M |
|---|---|---|
| gpt-5-nano | $0.03 | $0.24 |
| gpt-5-mini | $0.25 | $2.00 |
| gemini-2.5-pro | $1.25 | $10.00 |
| claude-sonnet-4-5 | $3.00 | $15.00 |
Worked example: a heavy personal month of 20M input and 5M output tokens costs $19.25 on gpt-5-mini, $85 on gemini-2.5-pro, and $135 on claude-sonnet-4-5. That spread is exactly why the group system exists — route summarization and boilerplate to the cheap catalog, and reserve the Claude catalog for work where its output quality earns the difference.
Getting started and honest limits
Signup is a username, a password, and an email verification code — about a minute — and new accounts receive ¥1 of credit, which is enough to run every step in this guide. Top-ups are Alipay only, starting at $1, with ¥1 = $1 of quota; invites give ¥1 to both sides. Two limits worth stating plainly: there is no card or PayPal payment yet, so this suits users who can pay with Alipay; and it is a small, new service, so treat the free credit as a way to verify your own workflow before committing real volume. Questions and failure reports go to [email protected].
Disclosure: I operate ZeroShell. Every price and behavior above is from the public pricing page and documented, tested endpoint behavior as of November 2026; check the pricing page for current figures.