Cloud spending limits

Which cloud and AI providers let you set a hard spending cap?

Most cloud providers do not give you a clean, account-wide hard spending cap. While services like Railway will kill your workloads when you hit a dollar limit and OpenAI rejects requests with a credit_balance_exhausted code once your balance runs dry, major platforms like AWS only refresh budget data up to three times a day, leaving an 8 to 12 hour window where runaway charges can keep piling up.

Even providers that advertise hard limits often exclude persistent storage, retain provisioning fees, or restrict caps to a tiny handful of services. If you want to avoid surprise invoices, you need to know exactly which resources stop, which keep charging, and where reporting delays leave you exposed.

Budget alerts are not spending caps

A budget alert sends you an email or a webhook when your spending crosses a target. That is it.

Your servers keep running, your traffic keeps flowing, and your credit card keeps getting charged. Cloudflare's budget alerts, for instance, notify you by email when account-wide usage crosses your dollar figure, but they are strictly informational and do not cap usage. Neon's Launch and Scale plans will email you at 80% and 100% of a monthly threshold, but they alert without stopping your database.

A real spending cap takes automated action to halt billing. It drops connections, terminates containers, or drops API requests until you manually add funds or raise your limit.

Hard spending limits across 23 providers

The table below breaks down native controls across 23 cloud, AI, and developer platforms based on their official documentation.

ProviderHard cap available?What it does when reachedThe catch
AWSPartialAWS Budgets actions apply IAM policies, SCPs, or target EC2 and RDS instances.Updates occur only 8 to 12 hours apart; charges can keep growing before notifications fire. First two action budgets are free, then $0.10 daily.
Google CloudPartialSpend caps pause specified services at 100% of gross estimated list price.Only 4 services eligible (Gemini API, Gemini Enterprise Agent Platform, Cloud Run, Cloud Run functions); single project only; storage, VMs, and Provisioned Throughput keep billing.
AzureCredit offers onlyDeploys disabled, VMs de-allocated, services shut off.Not available for pay-as-you-go or commitment plans; the limit equals your credit and cannot be changed; Marketplace items still bill.
CloudflarePartial (API)usage_block spend policy blocks further usage until the billing period ends.Only workers and durable_objects; dashboard budget alerts do not block; balances are asynchronous estimates.
GitHub ActionsYesBlocks GitHub-hosted runners when budget limit is met.First month only counts usage after budget creation date; mid-cycle setup can cause overages.
VercelPro / Enterprise"Pause Production Deployments" halts traffic and returns 503 DEPLOYMENT_PAUSED.Checks take several minutes; does not stop Blob storage, container storage, seats, AI Gateway, or v0 usage.
OpenAIYesRejects calls with credit_balance_exhausted or HTTP 429 when hard limits trip.Auto-reload is on by default during setup; enforcement is not instantaneous, so accounts can slip into a negative balance.
AnthropicYesPauses API calls until 00:00 UTC on the first of the month; custom limits return HTTP 400.Custom limits cannot exceed your tier's cap; cannot be set on the Default Workspace.
OpenRouterYesPer-key credit limits reject calls with HTTP 403 before reaching models.Only token prices are held in-flight; plugin charges, image pricing, and per-request fees are not held up front.
xAIYesRejects calls when prepaid balance hits zero if invoiced limit is set to $0.Auto top-up can be enabled with a monthly maximum; monthly invoiced limits cut off all responses until raised.
DeepSeekBalance-onlyReturns 402 - Insufficient Balance when prepaid funds run out.No calendar budget settings; you must check /user/balance or monitor the is_available flag.
Moonshot AI (Kimi)Not documentedUsage draws down your platform.kimi.ai account balance.Watch the balance; a top-up between two checks can hide what you spent.
DataForSEOYes (daily)Daily spending limits for the whole account or for single APIs and endpoints, set in the dashboard.Daily, not monthly; automatic balance top-ups can keep refilling the account.
ApifyYesLimits tab suspends platform services when usage hits the configured ceiling.Paid overages reach an immediate invoice if they hit $20 on Starter or $200 on higher tiers before cycle end.
Vast.aiBalance-onlyInstances are stopped automatically when balance hits zero or below.Stopped instances continue billing for disk storage; credit cards on file are auto-charged; without a card, data is destroyed.
RunPodBalance-onlyPods stop when balance reaches $0; default spend limit is $80/hour across resources.Pods without a Network volume are terminated and their data cannot be recovered.
RailwayYesHard limits shut down workloads completely.Agent limit ($5 Hobby, $20 Pro default) and Compute limits are separate; Agent limits cannot be removed.
NeonFree plan onlyFree plan suspends compute after 100 CU-hours or 5 GB of transfer, and blocks writes at 1 GB per project or 20 GB per account.Launch and Scale only email you at 80% and 100% of a dollar threshold; usage keeps running.
SupabasePro plan defaultDisallows extra usage on 12 covered items without charging overages.11 items are not covered (including Compute, disk IOPS, IPv4, log drains); unavailable for AWS Marketplace billing.
TursoPlan quotasQueries fail with a BLOCKED error code once quotas are exceeded.Extra storage, reads, and writes bill automatically once overages are turned on.
fal.aiNot documentedConcurrency starts at 2 requests and rises to 40 as you buy credits; extra requests queue.Queuing slows a runaway loop but does not cap what it spends.
TwilioWebhook onlyUsageTriggers send a webhook to a callback URL when usage or price thresholds trip.Evaluated roughly once a minute; does not stop calls or messages on its own.
ElevenLabsYesCredit quotas per API key limit usage.Quotas must be applied individually per key along with scope restrictions.

The catches that cause surprise bills anyway

Even when you enable these settings, bills can still show up. Why?

Persistent storage keeps charging

Stopping compute does not stop storage. If your Railway, Vercel, Vast.ai, or Google Cloud workloads are shut down by a cap, you still hold disk space. On Vast.ai, stopped instances continue billing for storage against your card. On Vercel, paused deployments leave Deployment Storage, Functions Storage, Vercel Blob, and Vercel Container Registry running on your monthly tab.

The 8 to 12 hour reporting lag

Cloud providers do not calculate billing synchronously. On AWS, Budgets information refreshes up to three times a day, typically 8 to 12 hours after the previous update. If a script goes wild, it can burn through hundreds of dollars before the system even registers that you passed your budget threshold. The same applies to Google Cloud, which explicitly warns that spend cap enforcement is not instantaneous and that you remain responsible for any overage costs accrued due to reporting latency.

Partial service coverage

Read the fine print on what the cap actually touches. Google Cloud spend caps became generally available on October 31, 2026, but they only cover four specific API services: Gemini API, Gemini Enterprise Agent Platform (formerly Vertex AI), Cloud Run, and Cloud Run functions. Spin up a Compute Engine instance or an unmanaged database in that project, and your spend cap ignores it completely.

Supabase operates the exact same way. Its Pro plan spend cap covers 12 specific usage items like Egress, Monthly Active Users, and Storage Size. But it leaves 11 items completely uncapped, including Compute, Branching Compute, Read Replicas, Custom Domains, and additionally provisioned Disk IOPS.

How to set hard caps on platforms that support them

If you use platforms with true spending caps, set them up properly on day one.

Railway: Workspace compute and agent limits

Railway allows you to configure strict caps via the web dashboard or its CLI. Because agent and compute usage are tracked separately, set both:

railway usage limit set --target workspace --soft 75 --hard 125
railway usage limit set --target agent --soft 7.50 --hard 20

When compute hits that hard limit, Railway shuts your workloads down completely to prevent extra billing.

Cloudflare: Spend policies via API

Cloudflare's blocking spend policies are created through the API with POST /accounts/{account_id}/billing/spend-policies. Set the action to usage_block for workers or durable_objects. Once the policy triggers, usage stays blocked until the billing period ends, or until you raise the threshold, disable the policy or delete it.

OpenAI: Prepaid settings and project caps

If you use OpenAI:

  1. Go to your billing settings and check your prepaid configuration. Auto-reload is enabled by default during setup; turn it off.
  2. Set a monthly spend limit at the organization or project level.
  3. Check the box for "Enforce a hard limit". If this is off, the limit acts as a passive monitor and lets calls proceed.

For Claude, navigate to platform.claude.com/settings/billing and configure spend limits on your workspaces. You cannot set spend limits on the Default Workspace, so set up separate workspaces for production and staging keys to keep them constrained.

Covering the gaps with Costbrake

Native controls are scattered, slow, and full of blind spots. That is why we built Costbrake.

Costbrake monitors your spending across 23 cloud, AI, and SaaS platforms, including AWS, Azure, Google Cloud, Cloudflare, OpenAI, Anthropic, RunPod, and Railway. Checks run hourly on the Free plan, every 5 minutes on Pro and Team, and speed up to as often as every minute during an active spike, depending on the provider. If an hour costs more than 3x your 7-day average and at least $5 more than usual, you get an immediate alert via email, Slack, Discord, webhooks, or PagerDuty.

When you need an emergency stop, Costbrake provides opt-in, reversible killswitches called brakes across 18 providers:

  • On AWS, you can throttle a runaway Lambda function to zero, stop an EC2 instance, shut down an IAM access key, or block Bedrock.
  • On Cloudflare, you can block Workers or Durable Objects with a spend policy, pause queues, or detach routes.
  • On GitHub, you can disable a workflow and cancel its queued and running runs, or set the organization's Actions budget to $0 with Stop usage on.
  • On OpenAI, you can freeze a project's or the organization's monthly hard spend limit at $0.01 (paid requests fail with a 429 once OpenAI enforces it, usually within minutes), and on xAI, you can disable an API key or freeze invoiced billing at $0.01 (prepaid credits keep being used).

Brakes only run when an admin clicks and confirms them in the app; Costbrake never brakes automatically, and it never deletes your resources. It uses read-only credentials wherever available, encrypted with AES-256-GCM.

Plans are flat-rate with no percentage-of-spend fees. The Free plan is $0 for 2 connections, Pro is $12 a month for 10 connections with brakes included, and Team is $39 a month. You can check out Costbrake pricing or point your AI assistant to our agent setup page to hook up your providers in minutes.

Questions and answers

Is an AWS Budget the same as a spending cap?

No. An AWS Budget tracks your spending and can trigger alerts or automated actions, but billing updates lag by 8 to 12 hours. Because charges can continue mounting before and after notifications trigger, an AWS Budget cannot guarantee an absolute spend ceiling.

What happens when an OpenAI account hits its limit?

When a prepaid account runs out of credits, API requests fail with a credit_balance_exhausted billing error, though access may not stop immediately and usage processed during the delay can result in a negative credit balance. If you configured a project or organization hard limit, requests fail once the system processes the threshold, though slight overages can happen due to processing delays.

Can Google Cloud shut down my whole project if spend gets too high?

Google Cloud spend caps only pause four specific serverless and AI services within a single project. To shut down everything, you must configure programmatic budget notifications via Pub/Sub to trigger a Cloud Run function that calls the Cloud Billing API to disable billing, which terminates all services in that project.

Does turning on the Supabase Spend Cap make my project completely free from overages?

No. The Supabase Spend Cap stops overages on 12 covered metrics like bandwidth and disk size, but 11 infrastructure items, including Compute, Read Replicas, and custom domains, are not covered and continue to bill.

Why do stopped cloud instances still cost money?

Stopping a virtual machine halts CPU and RAM charges, but the underlying disk storage volume remains allocated and reserved for your data. Providers like Vast.ai and Vercel continue charging for persistent disk space until the resource is permanently deleted.

Sources

Updated