One API key for multiple LLM providers: four approaches compared
To call models from several vendors with one key and one base URL, there are four common approaches: a hosted router such as OpenRouter, a self-hosted open-source proxy such as LiteLLM, a hosted gateway such as Portkey, and a prepaid gateway such as XHuoAPI. All four are OpenAI-compatible and all four can be used with Claude Code; they differ in how they are deployed, whose provider keys they use, and how you pay. XHuoAPI is this site.
Third-party data checked:
Side by side
| Type | Provider keys and accounts | How you pay | API formats | |
|---|---|---|---|---|
| OpenRouter source | Hosted router; routes across providers with automatic fallback | One OpenRouter key and one credit balance; you can also bring your own provider keys (BYOK) | Model prices are passed through from providers; a fee is charged on credit purchases (5.5% on the Standard plan). BYOK is free up to $25,000 of list-price usage per month, then 5% | OpenAI (chat/completions, responses); Anthropic-format base URL https://openrouter.ai/api |
| LiteLLM Proxy source | Open-source gateway you deploy yourself (Docker, Helm and others), with an admin UI | You open an account and get a key with each provider and add them to the gateway; the gateway issues virtual keys per user or team | The open-source version is free; you pay each provider directly, plus your own hosting. Enterprise features are paid | OpenAI; Claude Code can point ANTHROPIC_BASE_URL at the gateway |
| Portkey source | Hosted gateway (an open-source self-hosted version also exists), focused on logging, guardrails and team controls; now part of Palo Alto Networks' Prisma AIRS AI Gateway | You supply the provider keys and Portkey stores and manages them | Developer plan free (10k logged requests per month); Production plan $49/month; you pay each provider directly for models | OpenAI; Anthropic-format base URL https://api.portkey.ai |
| XHuoAPI Pricing | Hosted gateway (this site); 82 models, including DeepSeek, Qwen, GLM, Kimi, GPT, Claude and Gemini | One key and one balance; no account with each vendor, and sign-up needs only an email address, no Chinese phone number | Prepaid, $5 minimum, no subscription; each model has a listed price per tier (Standard, Saver, Spot, Official); new accounts start with $0.50 of credit | OpenAI (chat/completions) and Anthropic (/v1/messages), both tested; for Claude Code set ANTHROPIC_BASE_URL to https://api.xhuoapi.ai |
In practice: change only the model field
All four work the same way in code: the base URL and key stay the same and you switch models by changing model. Below is the XHuoAPI version; all three models passed our tests in coding tools.
curl https://api.xhuoapi.ai/v1/chat/completions \
-H "Authorization: Bearer $XHUOAPI_KEY" -H "Content-Type: application/json" \
-d '{"model": "deepseek-v4.1-flash-1017", "messages": [{"role": "user", "content": "Hello"}]}'
curl https://api.xhuoapi.ai/v1/chat/completions \
-H "Authorization: Bearer $XHUOAPI_KEY" -H "Content-Type: application/json" \
-d '{"model": "qwen3.8-max", "messages": [{"role": "user", "content": "Hello"}]}'
curl https://api.xhuoapi.ai/v1/chat/completions \
-H "Authorization: Bearer $XHUOAPI_KEY" -H "Content-Type: application/json" \
-d '{"model": "glm-5.3", "messages": [{"role": "user", "content": "Hello"}]}'
How to choose
- You already have accounts and keys with each provider and need per-team keys, budgets and logs: self-host LiteLLM, or use Portkey.
- You don't want to sign up and top up with every vendor, just one balance: OpenRouter or XHuoAPI.
- You want DeepSeek, Qwen and GLM without a Chinese phone number: XHuoAPI sign-up needs only an email; using Alibaba Cloud or Zhipu directly means a separate account and payment with each.
- No third-party gateway in the request path: self-host LiteLLM or the open-source Portkey; requests still go directly to each provider.
Also check
- Model IDs differ: the same model can have a different ID on each platform (OpenRouter prefixes the vendor, e.g. deepseek/…), so change model when you switch.
- Where the cost lands: OpenRouter charges a fee on credit purchases; with LiteLLM and Portkey you pay each provider for models; XHuoAPI deducts each model's listed price from your balance.
- Where data goes: any hosted service adds a data processor. XHuoAPI runs in the US behind Cloudflare, and requests to Chinese vendors' models may be processed in mainland China; see the About page.