Fix "402 insufficient_balance" (余额不足) errors
API Error: 402 {"type":"error","error":{"type":"insufficient_balance","message":"余额不足,请前往 https://www.ccsub.net/purchase 充值"}}CCSub's 402 insufficient_balance comes in three forms: no balance left, available balance below this request's estimate, or today's subscription quota used up. Here's how to tell them apart and what to do about each.
Fix it in 3 steps
- 1
Identify which of the three messages you got
余额不足 alone means your available balance is zero. 可用 $x,本次预估 $y means you have some balance, but not enough to cover this request's hold. 今日月卡额度已用完 means today's subscription quota is used up and you have no pay-as-you-go balance either.
- 2
Check your balance and today's quota
The dashboard home page shows your balance; the subscriptions page shows today's remaining quota. Blocked requests appear in the usage log at $0 — you weren't charged.
- 3
Top up or wait for the reset
Add pay-as-you-go balance on the purchase page, or wait for the subscription quota to reset at 00:00 Beijing time (UTC+8). If you clearly have enough balance, parallel requests are probably holding it; retry in a few minutes.
Other forms of the same error
余额不足(可用 $0.12,本次预估 $0.50),请前往 https://www.ccsub.net/purchase 充值今日月卡额度($50/天)已用完,将于北京时间 0 点重置;如需继续使用,请前往 https://www.ccsub.net/purchase 充值余额unexpected status 402 Payment Required: {"type":"error","error":{"type":"insufficient_balance","message":"余额不足,请前往 https://www.ccsub.net/purchase 充值"}}, url: https://www.ccsub.net/api/v1/responses
The message is in Chinese — here's what it says
CCSub returns all three variants with error.type set to insufficient_balance. The message text is Chinese, so here's the translation and what each one means.
1. 余额不足,请前往 … 充值 — "Insufficient balance, please top up." You have no active subscription and your available balance is zero or below. The fix is to add pay-as-you-go balance on the purchase page.
2. 余额不足(可用 $x,本次预估 $y)— "Insufficient balance (available $x, this request estimated at $y)." This is the confusing one, because your balance isn't zero.
It's caused by holds. Before forwarding each request, CCSub places a hold for an estimated cost based on the model. When the request completes, it charges the actual token usage and releases the difference. The current estimates in the code are roughly $0.50 per request for Opus-tier models, $0.15 for Sonnet-tier and $0.03 for Haiku-tier, multiplied by the pricing multiplier of the key's group. In practice:
- With $0.30 left, an Opus-tier request is refused because the $0.50 hold can't be placed, even if it would only have cost a few cents. Use a cheaper model or top up.
- Every in-flight request holds its own amount. If Claude Code is running several subagents in parallel, their holds can eat your available balance and the next request gets a 402. Once earlier requests finish and release their holds, you're fine again.
- An interrupted request can occasionally leave a stale hold. The system clears those every five minutes, so if you know you have enough balance, wait a few minutes and retry.
3. 今日月卡额度($N/天)已用完 — "Today's subscription quota ($N/day) is used up; it resets at 00:00 Beijing time." Subscriptions come with a fixed USD amount per day. It resets at midnight Beijing time (UTC+8), and whatever you don't use that day is gone — it doesn't carry over. Requests use today's quota first and then fall back to your pay-as-you-go balance automatically, so this message means both are empty. Wait for the reset or add some balance. The subscriptions page shows how much of today's quota is left.
Is it really my account?
CCSub's own 402 always has a Chinese message with a link to https://www.ccsub.net/purchase. If you see English text such as Insufficient Balance or insufficient account balance, it's not about you. When an upstream line has a billing problem, CCSub rewrites it as a 503 that says the upstream is temporarily unavailable and explicitly not about your account balance. See 503 upstream overloaded.
How it shows up in different tools
- Claude Code:
API Error: 402 {...}. It isn't retried automatically; after topping up, type "continue" in the same session. - Codex CLI:
unexpected status 402 Payment Required: {...}, url: https://www.ccsub.net/api/v1/responses. - Cursor, Cline, Cherry Studio and similar: usually print the message as-is in the chat panel.
- Your own code: HTTP 402 with
error.type=insufficient_balance. Surface a "top up" prompt instead of retrying in a loop.
Blocked requests are listed in your usage log at $0, so nothing was deducted.
FAQ
I still have balance. Why am I getting 402?
Before forwarding a request, CCSub places a hold for an estimated cost based on the model, then settles the actual usage and releases the rest when the request finishes. Available balance is your balance minus active holds. A small balance combined with an expensive model, or many requests at once, can trigger the 可用 $x,本次预估 $y message. Stale holds are cleared automatically every five minutes.
I have a subscription. Why do I see 402?
Subscriptions include a fixed USD amount per day that resets at midnight Beijing time; unused quota does not roll over. Once today's quota is gone, requests draw from your pay-as-you-go balance. You only get 402 when both are exhausted.
The message says "Insufficient Balance" in English. Is that my account?
No. CCSub's own 402 messages are in Chinese and include the purchase link. Balance problems on an upstream line are rewritten as a 503 saying the upstream is temporarily unavailable and that it's not about your account balance. Just retry later.
Am I billed for 402 responses?
No. A 402 is returned before anything reaches a model; these requests show up in the usage log with a cost of $0.
Still stuck?
- Read the troubleshooting guide (Chinese)
- Contact support: Email support@ccsub.net with the tool and version, your OS, the full error text, and your account email (never send your API key).
- Re-check your setup against the integration guide: Claude Code setup guide, Codex CLI setup guide, Cursor setup guide, Cline setup guide, Cherry Studio setup guide
Related errors
API Error: 429 {"type":"error","error":{"type":"rate_limit_error","message":"API Key request rate exceeded"}}Request-rate errors: raise the key's requests-per-minute or split traffic across keys. Concurrency errors: run fewer sessions or subagents at once — the limit is per account, so extra keys don't help.API Error: 503 {"type":"error","error":{"type":"overloaded_error","message":"上游线路暂时不可用,请稍后重试(不是您账户余额的问题) | Upstream temporarily unavailable, please retry shortly (this is not about your account balance)."}}CCSub already failed over between lines and none was free at that moment. Wait a minute and type "continue", or switch models with /model. Not billed, and not about your balance.API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid or disabled API key"}}The key never arrived or it's the wrong one. Check /status, re-copy the full key from the dashboard, and unset any leftover ANTHROPIC_API_KEY.
New to CCSub?
Sign up, create an API key in the dashboard, and paste it into Claude Code, Codex CLI or your editor. You pay for what you use.