callcthulu/cloudflare-cost-guard: self-hosted usage and subscription monitoring with optional Worker cutoff
An MIT-licensed Python tool that runs on your own Linux host to monitor Cloudflare usage and subscriptions, send budget warnings by email, Telegram, Slack or Discord, and optionally cut off approved stateless Workers. It observes by default and states it is not a spending cap.
- Products
- WorkersBilling
- Source
- Community resourceGitHub
- Author
- callcthulu
Key points
- Runs on an existing Linux host with Python 3.11+, SQLite and systemd, without third-party runtime packages; a synthetic demo runs the monitoring logic without credentials or network requests.
- Budget warnings can be USD amounts or percentages, with an optional hard limit; installation is read-only and does not start the timer, and cutoff requires a separate explicit arming step.
- Limitations it states: missing or stale data stays unknown, account charges cannot identify which domain caused a cost, and it is "not a spending cap". Not to be confused with louis-cai/cloudflare-cost-guard.
Original sources
Published
callcthulu/cloudflare-cost-guard: self-hosted usage and subscription monitoring with optional Worker cutoff
Open original sourceAn MIT-licensed Python tool that runs on your own Linux host to monitor Cloudflare usage and subscriptions, send budget warnings by email, Telegram, Slack or Discord, and optionally cut off approved stateless Workers. It observes by default and states it is not a spending cap.
More to read
hiromsaeden: an unindexed D1 GROUP BY loop produced $2,129.00 in invoices on a hobby project
On 2026-11-18, Cloudflare Community user @hiromsaeden published a post-mortem of a personal hobby project. An unindexed GROUP BY aggregate query scanned about 877,000 rows to return 30 rows; an unintended loop triggered about 315,000 runs across two billing cycles. In the 15 October–15 November cycle alone, 1,447,580,203,670 rows (1.44 trillion rows) were read. Invoice IN-83890481 was $529.88 USD (paid). Invoice IN-89082487 was $1,599.12 USD ($1,447.58 D1 Rows Read + $6.16 Workers CPU + $145.38 tax). Total billed was $2,129.00 USD; the expected budget was about $20/month. Support cases #02408621 and #02434399 led to a one-time courtesy credit of $953.74 (including a held $275.00), leaving a final balance of $645.38 USD; support said no further adjustments would be made. These amounts are the author’s invoices and credits, not a Billflare case total in this guide.
MrSaneApps: Workers AI usage above the startup-credit cap left $2,473.38 due; Cloudflare declined an invoice adjustment.
MrSaneApps posts what the author describes as a customer-service reply: Cloudflare is not able to adjust invoice IN-85233588 and $2,473.38 remains due; the plan covers Workers AI up to $2,500 over the program term, $2,503.84 in credits was applied to Workers AI usage and the rest billed at standard rates, and startup credits cannot be moved to cover Workers AI above that cap. The quoted reply says the dashboard Credits page showing a $50,000 Workers AI cap applies to the $350,000 tier, that an October 7 reply on case 02359041 should have pointed out the $2,500 cap, apologizes for both, and says the dashboard text was reported for correction without changing the program terms. The author says they were misdirected while trying to understand the plan terms, asks for a human to review the screenshots, and asks Cloudflare to forgive this month’s error.
Workers Free: SQLite Durable Object row-write quota can still block after the 00:00 UTC reset
Two Workers Free users with SQLite-backed Durable Objects report that after exceeding the 100,000 daily row-write allowance, storage still threw “Exceeded allowed rows written in Durable Objects free tier” after the documented 00:00 UTC reset, even though GraphQL analytics already showed 0 rows written for the new UTC day. @vendasecoplast1 saw 114,211 rows written and 399,088 rows read on 2026-11-16 UTC, then a failure at 2026-11-17 00:17:32 UTC during CREATE TABLE IF NOT EXISTS in the constructor. @dimoncheck2020 saw 103,558 rows written on 2026-11-18 UTC and 24 failed Durable Object invocations with 0 rows written between 00:00:00 and 00:35:27 UTC on 2026-11-19, with the same constructor exception at 00:35:21 UTC. No Cloudflare staff reply as of 2026-11-19.