OpenRouter 402 Insufficient Credits for Jev
Last checked · Independent guide, not affiliated with TypeSafe AI
OpenRouter returns HTTP 402 with 'Insufficient credits. Add more using https://openrouter.ai/credits' when your account balance cannot pay for the request. Jev (typesafe/jev-1.13) has no free tier on OpenRouter, so a new account needs credits before the first call. A few dollars covers tens of thousands of typical Jev requests.
The error
Section titled “The error”OpenRouter’s API reference for the Decisions endpoint documents the 402 response like this:
{ "error": { "code": 402, "message": "Insufficient credits. Add more using https://openrouter.ai/credits" }}OpenRouter describes 402 as “Payment Required”: insufficient credits or quota to complete the request.
Why it happens with Jev
Section titled “Why it happens with Jev”- No free tier. Some models on OpenRouter have free variants. Jev does not; it is billed at $0.042 per million input tokens and $0 for output, so every call needs a positive balance.
- A new account. OpenRouter accounts start with no credit unless you add some.
- A spending limit on the key. OpenRouter lets you cap how much an individual API key may spend. A key that has reached its cap can fail even when the account still has money. Check the key’s limit as well as the account balance.
How to fix it
Section titled “How to fix it”- Add credits at openrouter.ai/credits.
- If the account has credit but the error continues, check the spending limit on the specific key you are using, or create a new key.
- Retry the request. A 402 is not temporary, so automatic retries will not help until the balance changes.
How much credit you need
Section titled “How much credit you need”Very little. At Jev’s price, a request with a short message and three questions (about 450 input tokens in our tests on TypeSafe’s API) costs about $0.000019. OpenRouter’s documented example, 476 input tokens, costs $0.000019992. Five dollars of credit covers roughly 250,000 requests of that size, a little less after the payment fees OpenRouter adds when you buy credits.
Each OpenRouter response includes usage.cost, so you can track spending per call.
Related
Section titled “Related”- Jev on OpenRouter: endpoint, model name and request format
- Is Jev free?: the free options on other channels
- Jev API errors: every error by channel