Wild West API

Fixing "Spend limit reached ... will not cover this request"

This 402 means the money available to the key, after holds and caps, would not pay for the prompt plus even a minimal reply.

What the error says

HTTP 402
{
  "error": {
    "message": "Spend limit reached. This key has 0.000412 USD available, which will not cover this request.",
    "type": "insufficient_quota",
    "code": "budget_exceeded",
    "param": null
  }
}

The figure is real: it is the smallest of your account balance and any caps on the key, minus whatever is currently held for requests in flight.

How the API decides

For each request the API estimates the prompt cost, then works out how many output tokens the remaining money could pay for. It sets max_tokens to the smaller of what you asked for and what is affordable. If the affordable amount is below a floor of 16 output tokens, the request is refused with this message instead of being sent.

That is why the prompt size matters as much as the reply. A long roleplay with a big character card, lorebook entries and chat history can cost more to send than a nearly empty balance can cover, even before any reply.

How it shows up

SillyTavern shows the message in an error toast. OpenAI SDKs raise a generic status error with code 402 and do not retry. On /v1/messages, Anthropic clients see 402 billing_error.

Step by step fix

  1. Top up the account in /dashboard/, or raise the key's cap if a cap is the tight limit.
  2. If you cannot top up right now, shrink the prompt: lower the Context Size slider in SillyTavern so less history is sent.
  3. Check that no other requests are running on the same key; their holds reduce the available figure.
  4. Retry.

Per-token rates for each model are on the pricing page; a cheaper model also lowers the prompt cost.

Telling it apart from similar errors

budget_exceeded is decided before the hold, from the numbers alone. insufficient_credit (balance too low) and key_budget_exceeded (key cap reached) come from the hold itself failing. The fixes overlap: add money, raise the cap, or send less.

FAQ

Why does it say I have money available but still refuse?

The available amount has to cover the prompt plus at least 16 output tokens. A large prompt can cost more than a small remaining balance.

Will a shorter Max Response Length fix it?

Usually not on its own, because the API already lowers the reply length to fit. What it cannot lower is the prompt, so trim the context or add funds.

Related

Uncensored AI models on one key

OpenAI and Anthropic compatible, pay as you go. New to it? Start with uncensored AI, explained.