402 insufficient_credits shows up when your balance does not cover the request's reservation, even if the real answer would cost little. In Cline, what weighs most in the reservation is Max Output Tokens. Lowering it often fixes the error without buying credits.
How the reservation works
| 1 |
The reservation. Before calling the model, we count the input (about one token for every 3 characters) plus the maximum output asked for. With no maximum, the reservation counts 4096 output tokens.
|
|
| 2 |
Your balance is checked. If it does not cover the reservation, the answer is 402 and nothing is charged.
|
|
| 3 |
The adjustment. At the end, we charge the real tokens and the rest of the reservation goes back to your balance.
|
|
What to change in Cline
| 1 |
Open the Cline settings and the Model Configuration section.
|
|
| 2 |
In Max Output Tokens, enter 16000. With a low balance, a smaller value also works for small tasks.
|
|
| 3 |
Send the request again.
|
|
Do not go too low: the answer stops at the limit, and a big change to a file gets cut off halfway.
The input counts too
In a long task, each request carries more text, because it carries the conversation so far, and the reservation grows with it. If the 402 shows up in the middle of a long task, start a new task: the next request carries less text.
What the error tells you
The API answer includes details.required, what the reservation needed, and details.balance, what you have. If the gap is large, buy credits on the Buy credits tab. You can also see the balance in GET /v1/ai/balance.
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from $6.60/mo (3-year plan, with coupon) See plans |