Updated 2026-11-28 · 中文版
1. Install Claude Code and create a key
npm install -g @anthropic-ai/claude-code
Sign up, create an API key in the console and add balance.
2. Set three environment variables
export ANTHROPIC_BASE_URL=https://api.latentide.com
export ANTHROPIC_API_KEY=<YOUR_LATENTIDE_KEY>
export ANTHROPIC_MODEL=claude-sonnet-5-5
claude
Do not append /v1 to the base URL; Claude Code adds the path itself and a trailing /v1 leads to 404.
Windows PowerShell
$env:ANTHROPIC_BASE_URL = "https://api.latentide.com"
$env:ANTHROPIC_API_KEY = "<YOUR_LATENTIDE_KEY>"
$env:ANTHROPIC_MODEL = "claude-sonnet-5-5"
claude
Make it permanent: ~/.claude/settings.json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.latentide.com",
"ANTHROPIC_API_KEY": "<YOUR_LATENTIDE_KEY>",
"ANTHROPIC_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-5-5"
}
}
On Windows the file is %USERPROFILE%\.claude\settings.json. Restart Claude Code after editing it.
3. Verify before you start
curl https://api.latentide.com/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-5-5","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]}'
A JSON response means the key and base URL are correct. Each request then appears in the console with its token counts and charge.
Models and prices
USD per 1M tokens at build time. Claude Code marks prompt caching itself, so long sessions mostly pay the cache-read rate.
| Model | Input | Output | Official (input / output) | vs. official |
|---|---|---|---|---|
claude-fable-5-1 | $4.03 | $20.13 | $10.00 / $50.00 | -60% |
claude-fable-5-2 | $3.22 | $16.10 | $8.00 / $40.00 | -60% |
claude-opus-4-8 | $2.01 | $10.06 | $5.00 / $25.00 | -60% |
claude-opus-5 | $2.01 | $10.06 | $5.00 / $25.00 | -60% |
claude-opus-5-5 | $1.61 | $8.05 | $4.00 / $20.00 | -60% |
claude-sonnet-5 | $0.81 | $4.03 | $2.00 / $10.00 | -60% |
claude-sonnet-5-5 | $0.81 | $4.03 | $2.00 / $10.00 | -60% |
claude-haiku-5-5 | $0.10 | $0.50 | $0.10 / $0.50 | — |
Live prices: /models. OpenRouter-style IDs such as anthropic/claude-sonnet-5.5 also work; see Switch from OpenRouter.
Common errors
- 401: the key is incomplete or has extra spaces, or an Anthropic key is being used instead of a Latentide key.
- 404: the base URL ends with
/v1; remove it. - 402: balance too low; top up and retry. Failed requests are not billed.
- Model not found: check the model ID against /models.
- Settings ignored: another shell profile or system variable overrides
ANTHROPIC_BASE_URL.
Payment
Waffo checkout, charged in USD: Visa or Mastercard (cards issued outside China work), or international Alipay / WeChat Pay; $25 / $50 / $100 / $200 packs at face value plus 5%. Stablecoins, credited 1:1 with no fee: USDC on Base, USDC or USDT on BNB Smart Chain, USDT on Ethereum. Alipay in CNY is a separate channel, settled at the day's market rate plus 2%.
Latentide is an independent multi-model API gateway and is not affiliated with Anthropic, OpenAI, Google, xAI or OpenRouter. Model names are used only to identify the models served.