提供案例
billflare.

把费用上限写进 AI 生成的代码里

Prasenjit Sarkar(@stretchcloud)借 Durable Objects alarm 死循环指出:alarm 不需要流量也会计费;单个控制台的上限管不住跨多家厂商的 agent 工作;生成的代码本身要有执行配额、幂等检查和停机开关。

适用产品
Durable ObjectsWorkers
来源
作者经验𝕏
作者
Prasenjit Sarkar(@stretchcloud)

要点

  • 作者指出 Durable Objects alarm 在请求路径之外运行,循环在零流量、无人察看时仍持续计费。
  • 他写到 agent 重新调度、重试和重复处理同一上下文的速度快过人看账单;并称截至发帖时,Cloudflare 针对 Durable Objects 还没有与其他厂商支出上限相当的功能。
  • 他的观点是:单个云控制台的上限管不住跨多家厂商流转的 agent 工作;上限必须写进生成的代码:执行配额、幂等检查,以及不依赖有人及时看仪表盘的停机开关。
  • 他建议审查 AI 写的基础设施代码时,看它最坏会造成多少费用,而不只是测试是否通过。

原始来源

  1. 发布

    Prasenjit Sarkar(@stretchcloud)借 Durable Objects alarm 死循环指出:alarm 不需要流量也会计费;单个控制台的上限管不住跨多家厂商的 agent 工作;生成的代码本身要有执行配额、幂等检查和停机开关。

    Prasenjit Sarkar

    @stretchcloud · 𝕏 原帖

    A Durable Objects alarm looped quietly for 23 days before it turned into a $10,811.41 bill. No breach, no bad actor, just a handler that kept rescheduling itself every time it succeeded, reading and writing Cloudflare's storage layer trillions of times before anyone noticed the account was still live. The developer traces the original scheduling logic to a Codex session from late August, with a Claude-authored change three days later as a secondary contributor, by his own account, not an independent audit. Cloudflare's alarms run outside the request path, so a loop like this keeps billing with zero traffic and zero users watching. Support's first move was to decline a credit, pointing at the customer's own code. The reply was partly drafted by Workers AI running Kimi K2.7, which is its own small irony. This is not a one-off. A Claude agent on AWS Bedrock ran up a $30,000 bill through a loop with no circuit breaker and no alert from Cost Anomaly Detection. Another AWS agent hit $6,531 and effectively bankrupted the side project it was running. The pattern repeats because agents can reschedule, retry, and reprocess the same context faster than any human reviews a bill. The platforms are finally responding. OpenAI re-shipped monthly spend limits in September. Google shipped hard monthly caps for Gemini Enterprise on August 26, but by its own design it can only cap what it bills, not the Claude or Codex spend sitting on a different vendor's meter. Cloudflare still has nothing comparable for Durable Objects specifically. My read: a spend cap on one cloud's console was never going to fix an agent economy that routes work across four or five vendors in a single afternoon. The ceiling has to be written into the generated code itself, execution quotas, idempotency checks, a kill switch that doesn't depend on a human reading a dashboard at the right moment. Review AI-written infrastructure code for its worst financial outcome, not just whether it passes tests. Passing tests is exactly what this bug did for 23 days. https://t.co/RCqXyYhkSO
社区资源Workers +5

FlareCost:会使请求失败的 Free 计划限额(不计费)

FlareCost 的 free-plan-limits 页面在一张表中列出 Workers、KV、D1、R2、Durable Objects 和 Queues 的 Free 计量:每日 Free 限额在 00:00 UTC 重置,超额会使请求失败而不是计费,但 R2 例外,它在任何计划上超过每月免费额度后都会计费。于 2026-11-02 对照官方定价页面审核。

Workers AI

opsfork:MeloTTS 重试循环产生了 $391.50 的 Workers AI 费用;已申请减免。

Cloudflare 社区用户 opsfork(newsfork.com)申请全额减免账单周期 October 21 – November 20, 2026 的 $391.50 Workers AI 费用。作者称正常 Workers AI 支出约为每天 $1–2,但涉及 @cf/myshell-ai/melotts 模型的意外事件使可计费用量急剧增加,主要发生在 November 18–19。据作者所述,MeloTTS 原定于 November 20, 2026 弃用,但反复的模型故障约从 November 17 开始,早于该日期;这些故障触发了队列重试机制,作者重试实现中的缺陷放大了故障,产生了约 3.3 million 条排队消息。作者称几乎所有受影响的推理请求都是对同一批少数视频渲染任务的失败或冗余重试,且未产生可用输出。作者承认对重试缺陷负有责任,称循环已停止,并列出现已添加的防护措施,包括重试限制、指数退避、断路器和移除 MeloTTS。请求的解决方式包括调查弃用前的故障、排除异常用量、减免该事件导致的金额或发放等额一次性账户额度,以及修订发票;作者愿意支付合法的正常用量费用。已作为账单支持案例 #02445560 提交正式账单调整请求。社区 MVP sjr 回复称作者需要通过账单工单处理,且社区无法协助账单问题。公开帖中没有 Cloudflare 员工回复。

其他产品

Duncan (@ephraimduncan):信用卡被收取 $1,264,当时仍有 $7,032 Cloudflare 创业抵扣剩余。

Duncan (@ephraimduncan) 在 Cloudflare 向信用卡收取 $1,264、当时仍有 $7,032 创业抵扣可用之后,询问该联系谁。Cloudflare 社交媒体经理 Val Vesa 回复称这可能是故障,请私信提供账户邮箱和账单工单号以便内部升级并修复;Cloudflare 开发者布道师 Harshil 请通过私信发送详情以便转交团队。作者回复称详情正在发送。