Cloudflare: Spending Limits and Alerts Cloudflare introduced spending limits and email alerts for Workers and Durable Objects, blocking supported operations for a product once its account-wide monthly limit is reached until the next billing period or until the limit is changed. The controls, called spend policies in the billing API, can be configured in the Cloudflare dashboard or via the cf CLI and are meant to be used alongside AI Gateway spend limits, which cap per-user and per-model budgets for Workers AI and other AI providers on requests routed through the gateway. Workers limits count requests and CPU time but exclude the Workers Paid subscription fee, while Durable Objects limits count requests, duration, SQLite rows read and written, and key-value storage read, write, and delete operations, excluding stored data and the shared subscription fee; Cloudflare warns that metering delays and in-progress operations can let spend exceed a limit. Set spending limits for Workers and Durable Objects, or receive email alerts when spending reaches a threshold. Support for more products is coming soon. When a product reaches its spending limit, Cloudflare blocks supported operations until the next billing period or until you change the limit. Email alerts notify you without blocking usage. Use these controls alongside AI Gateway spend limits https://developers.cloudflare.com/ai-gateway/features/spend-limits/ to manage compute and AI inference costs across your application. AI Gateway supports per-user and per-model budgets for Workers AI and other AI providers, applied to requests routed through your gateway. In the billing API, a spending limit or email alert is called a spend policy . Choose how to configure spending limits and email alerts for Workers or Durable Objects: - Dashboard: Set a spending limit https://developers.cloudflare.com/billing/manage/spend-management/ set-a-spending-limit-in-the-dashboard for Workers or Durable Objects. - cf CLI: Create and manage spending limits and email alerts https://developers.cloudflare.com/billing/manage/spend-management/cli/ from your terminal or coding agent. | Control | Scope | What happens at the threshold | |---|---|---| | Spending limit | Workers or Durable Objects, across your account | Cloudflare blocks the product's supported operations. | | AI Gateway spend limit https://developers.cloudflare.com/ai-gateway/features/spend-limits/ | AI requests routed through your gateway, scoped by user, model, or provider | AI Gateway blocks matching requests until the budget window resets. | | Email alert | Workers or Durable Objects, across your account | Cloudflare emails the address you configure. The product keeps running. | | Budget alert https://developers.cloudflare.com/billing/manage/budget-alerts/ | Account-wide usage-based spend | Cloudflare emails your recipients. Products keep running. | Workers and Durable Objects each have a separate product-wide limit. A Workers limit does not include Durable Objects, Workers AI, Workers KV, R2, or other products used by your application. Workers and Durable Objects limits cannot target an individual Worker, Durable Object namespace, or billing metric. Choose each limit for the combined usage of that product across your account. Workers and Durable Objects limits use estimated usage charges for the product's current subscription billing period. Included usage is deducted before Cloudflare calculates these charges. Amounts are in US dollars. | Product | Usage charges counted toward the limit | Charges excluded from the limit | |---|---|---| | Workers | Requests and CPU time | The Workers Paid subscription fee and charges for other products | | Durable Objects | Requests, duration, SQLite rows read and written, and key-value storage read, write, and delete operations | Stored data and the shared Workers Paid subscription fee | Stored data can continue to incur charges while Durable Objects are paused. Reaching a limit does not cancel your subscription or remove existing stored data. Your invoice https://developers.cloudflare.com/billing/manage/invoices/ is the final record of charges. Metering delays, operations already in progress, and enforcement failures can allow spend to exceed a limit. You need permission to edit billing settings to manage limits. Before saving, review what stops for Workers https://developers.cloudflare.com/workers/platform/spend-management/ or Durable Objects https://developers.cloudflare.com/durable-objects/platform/spend-management/ . 1. In the Cloudflare dashboard ↗︎ https://dash.cloudflare.com/ , go to Billing for your account. Go to Billing ↗ https://dash.cloudflare.com/?to=/:account/billing 2. Select Spend Management . 3. In the Workers or Durable Objects row, select Edit the spending limit . 4. Enter an amount greater than zero, with up to two decimal places, in Monthly limit USD . Select Save limit . 5. Confirm that the limit is On . Saving a new limit turns it on. Editing an existing limit preserves its on or off setting. The limit applies to usage already recorded in the current period. For example, saving a $50 limit after the product has accrued $60 can trigger a pause as soon as Cloudflare evaluates the policy. Use the cf CLI to create spending limits or email alerts, update or remove them, and review their history. The cf CLI guide https://developers.cloudflare.com/billing/manage/spend-management/cli/ includes setup instructions and commands you can copy and run. Suppose you set a $50 spending limit for Workers for your account. Requests and CPU charges count together toward that limit, after included usage. php flowchart TD A "Workers usage charges below $40" -- B "$40: near the $50 limit" B -- C "$50 or more: limit reached" C -- |"After the limit takes effect"| D "New Worker invocations blocked" D -- E "Raise the limit above current spend