Connect Claude Code to WanAPIs
WanAPIs is a unified gateway that speaks both the OpenAI and Anthropic APIs. Point Claude Code's upstream URL at WanAPIs and you can use the Claude family — and other models — with a single key, paying only for the tokens you use.
Setup steps
- 1
Sign up and create an API key
Create an account in the WanAPIs console and generate an API key (it starts with sk-) on the API Keys page. New accounts get free trial credit.
- 2
Set the environment variables
Tell Claude Code where to send requests and which key to use. Add these lines to ~/.zshrc or ~/.bashrc to make them permanent.
shellexport ANTHROPIC_BASE_URL="https://api.wanapis.com" export ANTHROPIC_AUTH_TOKEN="sk-xxx" - 3
Launch and verify
Open a new terminal, run claude and send a message. A 401 usually means the key is wrong and a 402 means your balance is too low — you can check both in the console.
shellclaude
FAQ
Do I need an Anthropic account or subscription?
No. You only need a WanAPIs API key. Requests are billed per token from your WanAPIs balance.
Is it a monthly plan or pay-as-you-go?
Pay-as-you-go: you pay for the tokens you use, with no monthly plan to waste. The console shows prompt/completion tokens and the charge for every request.
Which models are supported?
The whole Claude family plus GPT, Gemini, DeepSeek, Kimi, GLM and more, all with the same key. See the model marketplace for the full list and prices.
Connect Claude Code to WanAPIs now
One API key for GPT, Claude, Gemini, DeepSeek, Kimi, GLM and more — pay only for the tokens you use.