billflare.

AI Gateway spend limits

Cloudflare documents cost-based budgets on an AI Gateway that block requests, or fall back to a cheaper model, once cumulative spend in a time window reaches the limit.

Products
AI GatewayWorkers AI
Source
Official docsCloudflare Docs
Author
Cloudflare

Key points

  • Spend limits are configured per gateway. Each rule sets a dollar budget over a rolling or fixed time window, can be scoped by model, provider or custom metadata such as user ID, and a gateway can have up to 20 rules.
  • When a limit is exceeded, AI Gateway returns 429 and blocks requests until the window resets by default; alternatively, a Dynamic Route can fall back to a cheaper model.
  • The docs say limits are eventually consistent: a request’s cost is recorded after it completes, so a burst of concurrent requests can briefly exceed the limit. Cost tracking is a best-effort estimate from token counts and model pricing, and the provider dashboard remains authoritative for billing.
  • Spend limits apply to Unified Billing and BYOK requests for models with known pricing.

Original sources

  1. Last updated

    AI Gateway spend limits

    Open original source

    Cloudflare documents cost-based budgets on an AI Gateway that block requests, or fall back to a cheaper model, once cumulative spend in a time window reaches the limit.

  2. Changelog: AI Gateway adds spend limits that track cumulative dollar spend by token usage and model pricing and block requests when the budget is exceeded, unlike rate limiting, which caps request counts.

    Open original source
Community resourceWorkers +2

Jono Chowdhury: a monitor-only Cloudflare billing bot across accounts

Jono Chowdhury (@ibuildthings) ran his Cloudflare billing check across 22 accounts: 7 had usage and none had metered overage. The bot he shares sends a daily digest and alerts only on real cost or free-allowance breaches, without changing billing.

Workers AI

opsfork: a MeloTTS retry loop produced a $391.50 Workers AI charge; a waiver was requested.

Cloudflare Community user opsfork (newsfork.com) asks for a full waiver of a $391.50 Workers AI charge for the billing period October 21 – November 20, 2026. The author says normal Workers AI spend is about $1–2 per day, but an unexpected incident involving the @cf/myshell-ai/melotts model sharply increased billable usage, mainly on November 18–19. According to the author, MeloTTS was scheduled for deprecation on November 20, 2026, yet repeated model failures began around November 17, before that date; those failures triggered a queue retry mechanism, and a defect in the author’s retry implementation amplified the failures, producing about 3.3 million queued messages. The author says almost all affected inference requests were failed or redundant retries of the same few video rendering jobs and produced no usable output. The author acknowledges responsibility for the retry defect, says the loop has been stopped, and lists safeguards already added, including retry limits, exponential backoff, a circuit breaker, and removal of MeloTTS. Requested resolution includes investigating the pre-deprecation failures, excluding the abnormal usage, waiving the amount attributable to the incident or issuing an equivalent one-time account credit, and a revised invoice; the author is willing to pay legitimate normal-usage charges. A formal billing adjustment request was submitted as Billing Support Case #02445560. Community MVP sjr replied that the author needs to work through the billing ticket and that the Community cannot help with billing issues. There is no Cloudflare staff reply on the public thread.

Community resourceWorkers +5

Polaris: self-hosted Free-plan remaining-quota and cost dashboard on Workers

etak64n/polaris is an MIT-licensed dashboard on Cloudflare Workers that shows how much of each Free plan limit is left and the cost/metrics of Workers, D1, R2, KV, Durable Objects, Queues, Workflows, Hyperdrive, Browser Run and Workers AI. It deploys behind Cloudflare Access and reads Analytics with an API token kept as a secret.