How do I cap my AI API bill? Claude and Gemini spend limits

Ship ItChecked against the official source

The short answer

Set a spend cap, not just an alert. On the Claude API, you set a monthly spend limit for each workspace in the Console, but you can't set limits on the Default Workspace, so make a workspace for your app. On the Gemini API, you set a monthly spend cap per project in AI Studio; Google notes that billing data runs about 10 minutes behind, so charges can go past the cap.

What to do

  1. Claude: create a workspace for your app, then set its monthly limit on the Spend limits tab.
  2. Gemini: in AI Studio, open the Spend page and edit the monthly spend cap.
  3. Other providers: look for a hard cap in billing, not just an alert.
  4. Keep the API key on your server, never in the browser.

Source

Checked on 3 Oct 2026. Prices, limits and settings change, so check the source before you rely on them.

Related