Thanks for the details. Based on current pricing for google/gemini-2.5-pro ("Starting at $1.25/M input tokens, starting at $10/M output tokens") and regular credits, $12 should be enough for many requests at your token size.
However, this error usually means one of the following:
-
The API calculates the maximum possible cost if you use all allowed output tokens (max_tokens).
- Even if you only input 1160 tokens, if you set
max_tokens to a high number (like "unlimited"), the API assumes you could consume the maximum allowed, and checks if your credits cover the worst-case cost.
- Example: If you set max_tokens to a very high value, the system may require enough credits for input + max output, even if you won't use them all.
-
To resolve this:
- Set
max_tokens to a lower explicit value that matches your expected output length (e.g., 500, 1000, etc.), instead of "unlimited."
- Try a request with
max_tokens set to 1000 and see if it works.
As quoted in the OpenRouter API docs: "You requested up to 8000 tokens, but can only afford 2045. To increase, visit https://openrouter.ai/settings/credits and upgrade to a paid account" – the system checks what you “could” spend, not what you “will” spend in a single request. This is a common pattern for preventing accidental large charges.
See pricing and cost calculation details at OpenRouter Models and Gemini 2.5 Pro.
If you keep running into this after reducing max_tokens, please contact the mods in Discord for manual review.
-# This is an automated response powered by Answer HQ. Use !mute to stop the bot from responding.