api.foo FAQ: Is It Official, Payments, Prompt Caching, Streaming and Privacy
On this page
Short answer: api.foo is an independently run third-party AI API service, not an official model-maker API. One account and one balance in Chinese yuan let you call 80+ models (see the model list) — Claude, GPT, Gemini, Grok, DeepSeek, Kimi, GLM, MiniMax and more — at https://api.foo, paid by Alipay, WeChat Pay, card or USDT.
When developers compare AI API providers, they usually check the eight things below. This page answers each one for api.foo and points to where you can verify it yourself. For an overview of the service, see What is api.foo.
The eight checks at a glance
| What to check | api.foo | Where to verify |
|---|---|---|
| Official or not | Not official. An independent third-party service that issues its own keys; no affiliation or partnership with model makers | Statement at the bottom of the About page (in Chinese) |
| API formats | Anthropic Messages, OpenAI Chat Completions / Responses and Gemini, all on the domain https://api.foo |
"Tested endpoints" below |
| Prompt caching | Claude models price cache reads and 5-minute / 1-hour cache writes separately; most other models only have a cache read price | Each model's page, e.g. claude-opus-5-5 |
| Streaming and long tasks | Streams are passed through as they arrive; long jobs can use the direct endpoint https://dc.api.foo, which bypasses Cloudflare |
"Streaming, long tasks and timeouts" below |
| Errors | HTTP status code plus a reason (401, 403, 429, 524 and so on) | "When something fails" below |
| Billing transparency | Every request is logged with model, input / output / cache tokens and cost | Console → Usage logs |
| Privacy | api.foo does not store prompts or outputs; only billing and troubleshooting metadata | Privacy policy (in Chinese) |
| Support | Public terms; tickets, email, QQ and Telegram groups | "Contact" at the end |
Is it official, and is it reliable?
api.foo is not an official Anthropic, OpenAI or Google service and has no affiliation or partnership with them; model names and trademarks belong to their owners. You sign up, top up and create keys on api.foo; your requests are forwarded to upstream model services and the results come back to you.
Section 4 of the Terms (in Chinese) says the service depends on upstream providers and networks, so rate limits, slowdowns and short outages can happen, and uninterrupted service is not promised. For production use, set up your own retries, budget limits and a fallback.
No one can prove "the model is real" in a sentence, so check it yourself:
- Check the usage log. The model name and unit price in the console usage log are the model you asked for, and the cost follows that model's price. (The
modelfield in the JSON response is filled in upstream and may carry a date suffix.) - Check caching. With prompt caching on (Claude Code turns it on by default), repeated requests show cache read tokens in the usage log and cost noticeably less.
- Check token counts. Send a very short message:
input_tokensin the response should be a dozen or so. Hundreds more means a hidden prompt was added on the way. - Check the output. Top up ¥5 and run a few tasks you know well, then compare with what you are used to.
Tested endpoints (November 5, 2026)
All four formats use the domain https://api.foo; only the path differs. On November 5, 2026 we sent each one with a test key (and tried the direct endpoint https://dc.api.foo too). Every request came back 401 无效的令牌 ("invalid token"): the URL and path are right and the request reached api.foo's key check, without spending money. The request body is only validated once you use a real key.
| Format | Endpoint | Typical clients |
|---|---|---|
| Anthropic Messages | POST https://api.foo/v1/messages |
Claude Code, anthropic SDK (set the base URL to https://api.foo) |
| OpenAI Chat Completions | POST https://api.foo/v1/chat/completions |
openai SDK, Cherry Studio, Cline, OpenCode (base URL https://api.foo/v1) |
| OpenAI Responses | POST https://api.foo/v1/responses |
Codex, openai SDK responses API (base URL https://api.foo/v1) |
| Gemini | POST https://api.foo/v1beta/models/<model>:generateContent |
Gemini CLI, google-genai SDK (base URL https://api.foo) |
This is for a macOS or Linux terminal (on Windows use Git Bash or WSL); put your own key in the first line:
export APIFOO_KEY="sk-your-key"
curl https://api.foo/v1/messages \
-H "x-api-key: $APIFOO_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-sonnet-5-5","max_tokens":64,"messages":[{"role":"user","content":"Hello"}]}'
If the variable is not set you get the same 401 无效的令牌 as with a wrong key. A response with "type":"text" and some text means it works. The key's group must include the model you request (here claude-sonnet-5-5; its model page lists the groups).
Claude models support Anthropic and Chat Completions, Gemini models support Gemini and Chat Completions, and most others Chat Completions; each model page has ready-made curl examples. Codex uses the Responses API — see the Codex guide. OpenAI-style clients also work without /v1 on api.foo, which adds it for you, but other providers may not, so the table above is the safe way. Setup guides: Claude Code, Codex, Gemini CLI, Cherry Studio.
How prompt caching is billed
With coding agents such as Claude Code, most of the input is repeated context, so the cache read price often matters more than the input price.
- Claude models have three cache prices:
- Cache read — the cached part of the input. Under Anthropic's official rules it costs 2.5–10% of the input price, depending on the model.
- Cache write (5 minutes) — charged the first time content is written to the cache; officially 1.25x the input price.
- Cache write (1 hour) — a longer-lived cache; officially 2x the input price.
- Other models (GPT, Gemini, DeepSeek and others) mostly have a cache read price only; check each model's page.
- Normal input and output are priced as usual.
Prices are on each model's page (for example claude-opus-5-5) and differ by group. Open a request in the console usage log to see how many tokens it read from and wrote to the cache.
Streaming, long tasks and timeouts
- Streaming: chunks are forwarded as soon as they arrive from upstream, not buffered.
- Default endpoint
https://api.fooruns behind Cloudflare: a non-streaming request that has not answered after about 120 seconds is cut off with a 524. Streaming usually avoids this. - Direct endpoint
https://dc.api.foobypasses Cloudflare and has no such limit — use it for long generations, large requests and image generation. It serves/v1and/v1betaonly, so opening it in a browser shows 404; that is expected. Changehttps://api.footohttps://dc.api.fooin your base URL (keep/v1if you had it) and keep the same key. - A stream that drops midway is usually an upstream error or a network blip. Retry; if it keeps happening, send the request id from the error to support.
When something fails
api.foo returns an HTTP status code and a reason. The common ones:
| Status / message | Usual cause | What to do |
|---|---|---|
401 无效的令牌 (invalid token) |
Wrong or truncated key, no key sent (empty variable), or the key is expired, disabled or has used up its own spending limit | Check the key's status and remaining quota in Console → API Keys |
403 用户额度不足 (insufficient balance) |
Not enough account balance | Top up in the wallet, or lower max_tokens |
| 403 model not allowed / IP not in list | The key has a model or IP restriction | Edit the key and lift the restriction |
无可用渠道 (no available channel), model not priced |
The model name differs from the model list (case matters), or the key's group does not include this model | Copy the name from the model page; use a key created in the right group |
404 Invalid URL |
Wrong path, e.g. /v1/chat/completion without the final s |
Compare with the paths in "Tested endpoints" |
| 429 | Too many requests, or the upstream is rate limiting | Lower concurrency and retry with growing waits |
| 5xx | Temporary upstream error | Retry after a few dozen seconds; if it persists, send the request id to support |
| 524 | A non-streaming request on the default endpoint took longer than about 120 seconds | Turn on streaming, or switch to https://dc.api.foo |
Error messages are in Chinese by default; sending the header Accept-Language: en returns some of them in English (for example Invalid token).
The table covers api.foo's own messages. For how OpenAI, Claude and Gemini errors and retries work in general, see API errors. After signing in, open Channel Status in the console sidebar to see recent test results for each group; if your key's group is red there, the problem is most likely upstream, not your setup.
Billing, top-ups, refunds and invoices
- How you pay: prepaid in Chinese yuan, charged per use (images per picture), no monthly fee. Without an invoice, ¥1 tops up ¥1 of balance; the minimum top-up is ¥5.
- Payment methods: Alipay, WeChat Pay, bank card, USDT (from ¥40; BSC / BEP20 network only, the amount received must exactly match the amount due, network fees are on top, and transfers on the wrong network cannot be recovered).
- Keys belong to groups: one balance covers every model, but each key belongs to one group, so different models may need keys from different groups. The model list shows which groups each model is in.
- Refunds: normal usage caused by misconfiguration, accidental calls, a leaked key or going over budget is not refunded unconditionally. Duplicate charges, payments that did not arrive and confirmed billing errors are refunded to the original method or re-credited after support checks them (section 3 of the Terms, in Chinese).
- Invoices: ordinary Chinese VAT invoices (增值税普通发票, not special VAT invoices) for single top-ups of ¥300 or more, with a company or personal title. An invoicing fee is deducted from the top-up: 5% for ¥300–1,999, 4% for ¥2,000–4,999 and 3% from ¥5,000 (a ¥500 top-up gives ¥475 of balance). Open a ticket with the order number and invoice details; it is issued within one working day.
Privacy and data
From the privacy policy:
- api.foo does not store conversations: prompts, context, attachments and model output pass through the server only while being forwarded and are not written to the database or logs.
- Only metadata is kept: time, model name, the name of the key used, input and output tokens, cost, latency and source IP.
- Exception: queued video and music jobs keep the prompt and result link so you can check progress and fetch the result.
- Requests are forwarded to upstream model services, whose own policies decide what they keep. Do not put ID numbers, passwords, keys or trade secrets in prompts.
Try it with ¥5 first
- Sign up and top up ¥5 in the console wallet.
- Create a key in Console → API Keys: pick a group that includes the model you want (each model's page lists its groups) and turn off unlimited quota so the key has a spending limit. When the limit runs out you will see "401 无效的令牌"; raise it in the console.
- Send the curl request above, then run one of your usual tasks in your own tool.
- Open the usage log and check the model name, tokens and cost. The curl above is too short to use the cache; to see caching, send two messages in a row from Claude Code — the second should show a few thousand cache read tokens.
- If you run long jobs, try the same with
https://dc.api.foo.
Contact
- Console → My tickets (open one): account, top-up, invoice and refund questions.
- Email: [email protected]
- QQ group 639791134, Telegram group t.me/api_foo
- Hours: 9:00–23:00 Beijing time, every day. For request errors, include the request id from the error message.
Related
FAQ
Is api.foo an official Anthropic, OpenAI or Google API?
No. api.foo is an independently run third-party AI API service with no affiliation or partnership with Anthropic, OpenAI, Google, xAI or other model makers; model names and trademarks belong to their owners. It issues its own API keys, forwards your requests to upstream model services and bills you in Chinese yuan.
Which API formats does api.foo support, and does it work with Claude Code?
Anthropic Messages (/v1/messages), OpenAI Chat Completions (/v1/chat/completions), OpenAI Responses (/v1/responses) and Gemini (/v1beta), all on the domain https://api.foo. Claude Code and Gemini CLI take the bare domain https://api.foo; Codex and OpenAI-style clients use https://api.foo/v1. Claude models support Anthropic and Chat Completions, Gemini models support Gemini and Chat Completions, and most others Chat Completions; Codex uses the Responses API - see the Codex guide.
How do I top up api.foo, and what is the minimum?
Prepaid in Chinese yuan and charged per use, with no monthly fee. Alipay, WeChat Pay and bank cards from ¥5; USDT (BSC) from ¥40. One balance covers every model, but API keys belong to groups, so create the key in a group that includes the model you want.
How is Claude prompt caching billed on api.foo?
Claude models have three cache prices - cache read, 5-minute cache write and 1-hour cache write - separate from normal input and output. Under Anthropic's official rules a 5-minute write costs 1.25x the input price, a 1-hour write 2x, and a cache read 2.5-10% of it. Prices are on each model's page, and the console usage log shows the cache reads and writes of every request.
What if a long request times out (524) or a stream disconnects?
The default endpoint https://api.foo runs behind Cloudflare, which cuts a non-streaming request that has not answered after about 120 seconds (error 524). Use streaming, or switch the base URL to the direct endpoint https://dc.api.foo, which bypasses Cloudflare and has no such limit; it serves the API only. A stream that drops midway is usually an upstream error or a network blip - retry, and if it keeps happening send the request id from the error to support.
Does api.foo give refunds or invoices?
Normal usage caused by misconfiguration, accidental calls, a leaked key or going over budget is not refunded unconditionally. Duplicate charges, payments that did not arrive and confirmed billing errors are refunded to the original payment method or re-credited after support checks them. Ordinary Chinese VAT invoices (增值税普通发票) are available for single top-ups of ¥300 or more; a 3-5% invoicing fee is deducted from the top-up.
Does api.foo store my prompts or code?
According to its privacy policy, api.foo does not. Prompts, context, attachments and model output pass through the server only while being forwarded and are not written to its database or logs. It records only billing and troubleshooting metadata such as time, model, key name, token counts, cost, latency and source IP. Queued video and music jobs are the exception. Upstream model services apply their own retention policies.
Found a mistake? Email [email protected].