# How do I stop an AI feature from running up a big bill?

> Cap it in two places. With your AI service, buy small prepaid credits, keep auto-reload off and set a monthly spend limit. In your app, have your AI tool add sign-in, a limit on uses per person and short answers, so one person or a bot can’t drain your credits.

Web page: https://buildladder.com/answers/ai-spending-limit

## What to do

- If you use the Claude API: In the Claude Console, open the Billing page. Under Spend limits, click Set limit and enter a monthly amount. Leave auto-reload off. Once you reach your limit, requests fail with a 400 error until you raise the limit or the month resets.
- If you use the OpenAI API: Auto-reload starts on when you first buy credits, so turn it off. Then open Project settings, select Limits, then Edit spend limit, and turn on Enforce a hard limit. Add a spend alert at a lower amount to get a warning first. The hard limit can go slightly over before it stops requests.
- If you use Gemini on the paid tier: In Google AI Studio, open the Spend page and click Edit spend cap under Monthly spend cap. Set it a little low, because billing can run about 10 minutes behind. An alerts-only budget in Google Cloud sends emails but doesn’t stop spending.
- If anyone can use your AI feature without signing in: Then anyone, including a bot sending thousands of requests, spends your credits. Ask your AI tool to require sign-in before the AI runs, and to limit how many times each person can use it in an hour and a day.

## What you do

- Buy credits in small amounts and keep auto-reload off.
- Set the monthly spend limit or cap in your AI service’s billing settings.
- Decide whether people must sign in first, and how many uses each person gets.
- Check your AI service’s usage page often in the first weeks after you put it online.

## What your AI tool does

- Make the AI feature work only for signed-in people.
- Add a limit on how many times each person can use it in an hour and a day.
- Cap how long people’s input can be, and how long the AI’s answer can be.
- Compare a smaller, cheaper model and tell you what one use costs with each.
- Show a clear message when a rate limit, a spend limit or an empty balance stops a request.
- Check that the key is only in server code, and never in files a browser or phone downloads.

## Prompt to copy

```text
I want to make sure my app’s AI feature can’t run up a big bill.
Look at how my product calls the AI service. Then check that service’s current official docs on spend limits, rate limits and errors, and do this:
- Tell me, step by step, how to set a monthly spending limit in its billing settings. I’ll do the clicking. Don’t change any account settings yourself.
- Make the AI feature work only for people who are signed in. If my app has no sign-in yet, explain my options and what each costs, and wait for my choice.
- Add a limit on how many times one person can use the feature in an hour and in a day. Ask me what the limits should be.
- Cap how long a person’s input can be, and how long the answer can be.
- Check whether a smaller, cheaper model would do the job, and tell me what one use costs with each.
- Show a clear message when a limit is reached, when credits run out, or when the service is busy.
```

## Sources

Updated 2026-11-10.

- [Claude API spend and rate limits](https://platform.claude.com/docs/en/api/rate-limits)
- [Claude: paying for API usage](https://support.claude.com/en/articles/8977456-how-do-i-pay-for-my-claude-api-usage)
- [OpenAI spend limits and alerts](https://developers.openai.com/api/docs/guides/spend-limits)
- [OpenAI: prepaid API billing](https://help.openai.com/en/articles/8264644-setting-up-and-managing-prepaid-api-billing)
- [Gemini API billing and spend caps](https://ai.google.dev/gemini-api/docs/billing)
- [Gemini API pricing](https://ai.google.dev/gemini-api/docs/pricing)
- [Google Cloud budgets and alerts](https://docs.cloud.google.com/billing/docs/how-to/budgets)
