Home → Guides → Base URL setup for coding agents
Every one of these tools accepts a custom endpoint. Half of them want the base URL with /v1 and half want it without, and the error you get for choosing wrong is deliberately unhelpful.
| Client | Base URL |
|---|---|
| Claude Code | https://apiclan.us |
| Anthropic SDK | https://apiclan.us |
| Codex | https://apiclan.us/v1 |
| Cursor | https://apiclan.us/v1 |
| Cline, Roo Code | https://apiclan.us/v1 |
| LM Studio | https://apiclan.us/v1 |
| Cherry Studio, Chatbox, LobeChat | https://apiclan.us/v1 |
Anthropic-lineage clients build the full path themselves: you give them a host and they
append /v1/messages. OpenAI-lineage clients expect the base URL to already
contain /v1 and append only /chat/completions. Neither is
wrong; they simply split the URL at a different point.
Put /v1 in a Claude Code config and the request goes to
/v1/v1/messages. Leave it out of a Cursor config and it goes to
/chat/completions. Both paths exist on no server.
A wrong path returns a 404 at the edge. The request never reaches the gateway, so nothing appears in your usage history. A wrong or revoked key returns 401 and does show up. So:
/v1 first.Cursor validates the endpoint when you save settings by sending a probe request with whatever model ID is currently selected. If that ID is not one your key can reach, the check fails even though the endpoint is correct. Add a model ID from the price list by hand, select it, then save.
Knowing where the value lives saves a round of guessing when a change appears not to take effect:
ANTHROPIC_BASE_URL and
ANTHROPIC_AUTH_TOKEN environment variables. Set them in the shell that
launches it, not in a dotfile a different shell reads, and restart the session
— the value is captured at startup.Put the key in an environment variable rather than a config file you might commit. Anyone holding a key can spend the balance on it.
Use the exact strings from the price list. Hyphens are not interchangeable with dots:
the model is claude-fable-5-1, not claude-fable-5.1. A
misspelled model name produces the same silent 404 as a wrong path, for the same
reason.
Full setup walkthroughs for each client, including the model list, are in the Quickstart.
No subscription, no monthly minimum, no sales call. Top up with USDT and spend what you use — 1 USDT gives you 2 credits of API balance.
Read the 30-second quickstartPrices quoted on this page are regenerated automatically from live billing data. Third-party terms are quoted from that party's own published documentation.