A 402 with insufficient_credits means your AI credits do not cover the reservation for the request. Nothing was charged. It almost always has two fixes: buy credits or ask for a shorter answer.
What the error contains
{
"error": {
"code": "insufficient_credits",
"message": "Not enough credits for this request. Nothing was charged.",
"correlation_id": "0f8fad5b-d9cb-469f-a165-70867728950e",
"details": { "required": 46.12, "balance": 12.5 }
}
}
| Field |
What it means |
| required |
The credits the request needs to reserve before calling the model. |
| balance |
The credits the account has right now. |
In the example, the request needed 46.12 credits and the account had 12.5.
Why the reservation can be bigger than the cost
Before calling the model, we reserve credits for the input (about one token per 3 characters) and for max_tokens of output. Without max_tokens, the reservation counts 4,096 output tokens. At the end we charge only what was used and the rest goes back to your balance. That is why a cheap request can be refused if the maximum output is high.
An example, with the price the documentation gives for moonshotai/kimi-k2.6 (1,600 credits per million output tokens): without max_tokens, the output alone reserves 4,096 × 1,600 / 1,000,000 = 6.55 credits. With max_tokens at 500, it drops to 0.8. Current prices are on the Models tab.
How to fix it
| 1 |
Buy credits on the Buy credits tab, or through the API.
|
|
| 2 |
Lower the maximum output: max_tokens in the API, "Maximum tokens in the reply" in the Playground, --max-tokens in aio, CLAUDE_CODE_MAX_OUTPUT_TOKENS in Claude Code or Max Output Tokens in the tools that have it.
|
|
| 3 |
Send less text: a long conversation or a big document all count as input.
|
|
| 4 |
Or choose a cheaper model.
|
|
In the Playground, the same case shows as "This request holds X credits and your account has Y. Buy credits and try again." For images, video and voice, the reservation comes in credits_reserved and a generation that fails costs nothing.
|
Do not confuse it with insufficient_credit, without the "s". That one is the account balance in Kz, for purchases through the API. And with a Coding Plan, when the points run out and there are no credits, the answer is 429 with plan_limit_reached, not 402.
|