api.foo Docs
api.foo is an LLM API aggregator: with one account and one balance, create API keys in the console (keys are per group; the Models page shows which groups each model is in) and call Claude, GPT, Gemini, DeepSeek and other models through a single endpoint. OpenAI, Claude (Anthropic) and Gemini request formats are all supported.
Endpoints
| Route | Base URL | Best for |
|---|---|---|
| Default | https://api.foo |
Everyday use, connected straight to our server with no CDN, so long tasks and large requests work too. Works with or without /v1 |
| Relay | https://cf.api.foo |
Goes through Cloudflare; switch to it if the default address cannot connect. It has a timeout of about 120 seconds, so keep long jobs on the default. API only |
| Direct | https://dc.api.foo |
Older address on the same route as the default; no need to change it if you use it. API only |
Get started in three steps
- Sign up at api.foo, open Console → API Keys and click Create API Key.
- Top up in Console → Wallet and pay as you go. You can pay by card (Stripe), Alipay, WeChat Pay or USDT on BNB Smart Chain (from ¥40). Balances and prices are in Chinese yuan (CNY, ¥).
- Paste the base URL and key into your tool — see the guides below.
Model IDs and prices are listed on the Models page.
All guides
Get started
| Goal | Guide |
|---|---|
| Install Claude Code on macOS, Windows or Linux | Install Claude Code |
| Point Claude Code at a custom API or base URL | Claude Code with a custom API |
| Install Codex CLI and set up config.toml | Install Codex CLI |
| Install Gemini CLI or use a custom endpoint | Install Gemini CLI |
| Switch Claude Code and Codex providers in one click | CC Switch guide |
| Add a custom API provider in Cherry Studio | Cherry Studio guide |
| Use your own API key or base URL in Cursor | Cursor API key setup |
| Set up Cline in VS Code or the Cline CLI | Cline setup guide |
Pricing & API keys
| Goal | Guide |
|---|---|
| Understand what Claude Code costs | Claude Code pricing |
| Compare Claude API prices and estimate costs | Claude API pricing |
| Call the Claude API from mainland China: three options compared | Claude API from China |
| Compare OpenAI API prices | OpenAI API pricing |
| Check DeepSeek API prices and off-peak discounts | DeepSeek API pricing |
| Get started with the Grok API | Grok API guide |
| Check Kimi K3 prices, API keys and rate limits | Kimi API guide |
| Check GLM-5.3 prices, free models and the Coding Plan | GLM API guide |
| Check MiniMax-M3 prices and the M2.7 retirement | MiniMax API guide |
| Generate images with Nano Banana | Nano Banana API |
| Generate images with GPT Image 2 | GPT Image 2 API |
| Get an Anthropic API key | Get a Claude API key |
| Get an OpenAI API key | Get an OpenAI API key |
| Choose between Claude Code, Codex, Cursor and OpenCode | Claude Code vs Codex vs Cursor vs OpenCode |
Concepts & errors
| Goal | Guide |
|---|---|
| Learn what api.foo is, how billing works and how to reach support | What is api.foo |
| Check before you sign up: official or not, caching, long tasks, privacy, refunds | FAQ |
| See how these docs are tested and where prices come from | How we test |
| Learn what "OpenAI-compatible" really means | OpenAI-compatible APIs explained |
| Compare alternatives to the OpenAI API | OpenAI API alternatives |
| Find LLM APIs with a real free tier | Free LLM APIs |
| Fix 401, 403, 429 and 529 errors | LLM API errors explained |
| Invite friends and earn top-up rewards | Referral rewards |
Found a mistake? Email support@api.foo.