billflare.

Cloudflare free plan from scratch: which services bill on overage, and what to set up first

李天才 (@Lniosytest) re-walks a popular Cloudflare beginner tutorial (domains, email routing, R2, Workers AI) against the October 2026 docs, prompted by the $10,811 Durable Object alarm bill, and adds a table of what happens on overage plus a pre-flight list for avoiding a runaway bill.

Products
WorkersKVD1Workers AIR2Durable ObjectsAI Gateway
Source
Author experience𝕏 article
Author
李天才|TianCai (@Lniosytest)

Key points

  • The author’s rule of thumb: on the Free plan, Workers, KV, D1, Workers AI and the Durable Objects available there return errors once the free quota is used up and reset the next morning at 08:00 Beijing time, with no charge; R2 needs its own subscription and bills overage monthly, and after upgrading to Workers Paid (from $5 a month) overage is billed by usage. Cloudflare’s current Workers limits page says the Free daily request limit resets at midnight UTC and further requests get error 1027 or fail open, and its Workers AI pricing page says Free accounts must upgrade to go past 10,000 Neurons a day.
  • On R2 he notes that billing rounds up — Cloudflare’s own example counts 1,000,001 operations as 2 million and 1.1 GB as 2 GB — that the r2.dev development URL is rate-limited and cannot use cache, WAF rules or access control, so images should go through a custom domain, and that subscribing requires a valid payment method and may place a temporary preauthorization on the card. Cloudflare’s current R2 pricing page and billing policy page say the same about rounding up and payment methods.
  • For sites deployed as Workers, he points out that static asset requests are free and unlimited, but paths routed through the Worker with run_worker_first return 429 once the free quota is exhausted instead of falling back to static files; and a Workers AI demo on a public workers.dev address spends quota on every visit, so turn off public access or delete the Worker after the demo, and consider putting AI Gateway in front to rate-limit calls. Cloudflare’s current static assets billing page confirms the run_worker_first 429 behavior.
  • His pre-flight list: stay on the Free plan where possible; keep R2 to image hosting and backups with cache and WAF rules on the custom domain; after upgrading, first create a budget alert under Billing → Billable usage, remembering it only sends email, does not pause or cap usage, and is only for Pay-as-you-go accounts; give cron jobs, Durable Object alarms and queues a loop count limit, run them locally first and watch the usage page on launch day; on Workers Paid set a per-Worker CPU limit (default 30 seconds, up to 5 minutes, the official example uses 100 ms) and a subrequest limit; and delete Workers you no longer use. Cloudflare’s current budget alerts page, Workers limits page and Durable Objects pricing page (which counts alarm invocations as requests) support these points.
  • He concludes that, for the services used in the article, there is no entry point for usage charges unless you subscribe to R2 or Workers Paid, and says his figures follow the October 2026 docs and may change.

Original sources

  1. Published

    Original post

    Read on 𝕏

    李天才 (@Lniosytest) re-walks a popular Cloudflare beginner tutorial (domains, email routing, R2, Workers AI) against the October 2026 docs, prompted by the $10,811 Durable Object alarm bill, and adds a table of what happens on overage plus a pre-flight list for avoiding a runaway bill.

    李天才|TianCai

    @Lniosytest · Original 𝕏 post

    https://t.co/G9cRNeTsae
    Read originalArchived

    李天才|TianCai · @Lniosytest

    CF白嫖指南:Cloudflare 账单爆了 1 万刀!免费版从入门到精通:建站、域名邮箱、R2 存储、Workers AI 通关

    前几天我在 X 上看到有人晒 Cloudflare 账单:10,811.41 美元,他已经全额付掉了。 先说清楚,这单没被人刷。按他自己的说法,一个项目里的 Durable Object 定时器(alarm)写成了死循环,读写跑了 6 万亿次,代码是 Vibe Coding 让 AI 写的。他开的是付费版,按量计费,循环不停,账单就一直涨。 我人傻了。 同一周,我在 X 上看到有人写了一篇 Cloudflare 万字教程,从接域名一路讲到 Workers AI 和新出的 cf 命令行。10 月 9 日早上发的,到当天晚上 10 点收藏 605,比点赞(271)多一倍还多,大家都是存着当手册用。 我按那篇的顺序重新捋了一遍,每个免费额度都去 Cloudflare 官方文档对了原话,又加了一节它没细讲的:哪些服务超额会扣钱,怎么防。 我自己的个人站现在是 Next.js 放在 Vercel 免费版,没搬过来。这篇适合想把域名、邮箱、图床和一个小 AI 接口都放进一个账号的人。 一张表:免费额度和超额后果 先记一条:Workers、KV、D1、Workers AI 这四样,免费版用超了就是报错,第二天北京时间早上 8 点额度重置,不扣钱。 R2 对象存储要单独开订阅,超出免费额度按月出账。升级到 Workers 付费版(每月 5 美元起)以后,超出的部分也是按量算。 一、把域名接进 Cloudflare 在 Cloudflare 控制台点「域名」,选接入新域名,填不带 www 的根域名,套餐选 Free。 Cloudflare 会扫一遍你现有的 DNS 记录。扫描结果经常漏东西,那篇教程提醒重点对三类:根域名指向哪、www 在不在、邮箱的 MX、SPF、DKIM 有没有漏。邮件记录漏了,切过去以后最常见的结果就是收不到信。 然后回到买域名的地方(Namecheap、Spaceship、阿里云都行),把域名服务器(NS)换成 Cloudflare 给你的那两条。 改之前先把注册商那边的 DNSSEC 关掉。官方文档原话的意思是,开着 DNSSEC 改 NS,域名可能直接打不开。等 Cloudflare 显示已激活,再在 Cloudflare 里把 DNSSEC 开回来。 二、橙色云、灰色云和 SSL 模式 DNS 记录后面那朵云,橙色是「已代理」,访客先到 Cloudflare 再到你的服务器,CDN、HTTPS 证书和防护都靠它;灰色是「仅 DNS」,Cloudflare 只管解析。 网站用橙色云。SSH 登录用的域名、邮件服务器的 A 记录、游戏和数据库端口,这几种要灰色云,开了代理就连不上。那篇教程里有个习惯我直接抄了:网站一个开代理的域名,SSH 和面板另配一个灰色云的子域名。 SSL/TLS 加密模式现在默认是自动(Automatic SSL/TLS),官方还在分批推,没轮到的账号只能手动选。手动的几档是 Off(不加密)、Flexible(灵活)、Full(完整)、Full (strict)(完整严格),官方建议能用 Full 或 Full (strict) 就别用别的。服务器上装了有效证书,直接选 Full (strict)。 最常见的翻车是选了 Flexible:Cloudflare 用 HTTP 回源,服务器又把 HTTP 强制跳 HTTPS,两边来回跳,浏览器报 ERR_TOO_MANY_REDIRECTS(重定向次数过多)。官方给的解法两条,去掉服务器上的 HTTPS 跳转,或者改成 Full 以上,前提是服务器上有证书。 最后在「边缘证书」里打开「始终使用 HTTPS」,让 Cloudflare 来做跳转,服务器那边就不用再跳了。 三、建站:GitHub 仓库导入,推送就自动部署 那篇教程发现现在新建项目默认走 Workers,从 GitHub 导入仓库,构建完作为 Worker 部署,Pages 成了旧入口。好处是官方计费页的原话:访问静态资源的请求免费且不限量。 步骤: 计算 → Workers 和 Pages → 创建 → 从 GitHub 导入存储库。授权的时候只勾要部署的那个仓库。 纯 HTML 不填构建命令;Astro、Hugo、VitePress 这类框架填对应的构建命令。部署命令保留默认的 npx wrangler deploy。 部署完会拿到一个 Cloudflare 送的免费子域名地址,以后往 main 推代码就自动重新部署。 项目的「域」标签页里添加自定义域名,DNS 记录自动建。 两个限制:已经有 CNAME 记录的主机名不能直接绑,要先删掉那条记录(官方原话);Workers 免费版一个版本最多 2 万个静态文件。用旧版 Pages 的话,每月 500 次构建,一次只能跑 1 个,单文件最大 25 MiB。 如果你在配置里用了 run_worker_first,让某些路径先过 Worker,免费额度用完以后这些路径会直接返回 429,不会退回去走静态文件。 我的站是 Next.js 带服务端渲染,搬过来要先弄清 SSR 那部分怎么跑,所以暂时不动。纯静态的博客、作品页、文档站,放这里很合适。 四、域名邮箱:Email Routing 邮件路由 想要一个「hi@你的域名」挂在网站和名片上,用 Email Routing(邮件路由)就行。免费版收信不限量,收到的信转发到你的 Gmail、Outlook 或 QQ 邮箱。 它只负责收和转发。拿这个地址对外发信是另一个功能(Email Sending),发给任意收件人要 Workers 付费版。 步骤: 计算 → 电子邮件服务 → 电子邮件路由 → 接入域名,按提示加 MX、SPF、DKIM 记录。 「目标地址」里加你的常用邮箱,去邮箱点验证链接。 「路由规则」里建一条:hi 加你的域名,操作选发送到电子邮件,目标选刚验证的邮箱。 每个域名最多 200 条规则,每个账号最多 200 个目标地址。可以 github@、shop@ 各建一条,哪个地址开始收垃圾邮件就删哪条。 坑:这个域名以前在用别家企业邮箱的话,原来的 MX 会跟它冲突,开之前想清楚信到底归谁收。 五、R2 对象存储:图床和备份 R2 是 Cloudflare 的对象存储,兼容 S3 接口,图片、视频、备份包都能放。它最出名的一点是出站流量免费,图片被访问再多次,下载流量这块不收钱。 免费额度每月 10 GB 存储、100 万次 A 类操作(写入、列出这类)、1,000 万次 B 类操作(读取这类),只算标准存储。建桶时存储类别选「不频繁访问」,就用不了免费额度。 开通这步要先说:R2 得在控制台走一遍订阅流程(checkout)。Cloudflare 计费政策写明,开订阅之前账号里要有有效的付款方式,卡或者 PayPal 都行;按量计费的服务还可能先对卡做一笔临时预授权,只冻结不扣款。社区里有人开 R2 的时候看到的是 5 美元的预授权。手上没有能用的卡,R2 这节可以先跳过。 步骤:存储和数据库 → R2 对象存储 → 创建存储桶,存储类选标准。名字一开始就想好:官方 API 修改存储桶只能改存储类别和数据所在区域,没有改名这一项,想换名只能新建一个桶再把文件搬过去。桶名只能用小写字母、数字和连字符,3 到 63 个字符。 公开访问有两条路,正式用一定选自定义域,比如 img 开头的子域名。另一条是 r2 开发地址,官方原话是这个地址限速,只适合开发用,也挂不了缓存、WAF 规则和访问控制。 两个跟钱有关的细节: R2 计费向上取整。官方举的例子,100 万零 1 次操作按 200 万次算,1.1 GB 按 2 GB 算。 R2 不走 Workers 免费版那套「超了就报错」,超出免费额度按月出账。 还有,设置页上方的 S3 API 地址里带着你的账户 ID,截图分享前打码。 六、挡 AI 爬虫:AI Crawl Control 和 AI 迷宫 现在 OpenAI、Anthropic、字节这些公司的爬虫天天在抓网页。原作者的演示站是个小站,7 天里 AI 爬虫就来了 974 次。 域名菜单里的 AI Crawl Control 所有套餐都能用,能看到每家爬虫来了多少次,一家一家选放行或拦截。付费套餐还能改拦截时返回的状态码,403 或 402 二选一,免费套餐没这个设置。搜索引擎类的爬虫一般放行,拦了网站会在搜索结果里消失。 AI 迷宫(AI Labyrinth)在 安全性 → 设置 里,目前还是 Beta。它会在网页里加一批访客看不见的 nofollow 链接,把不守规矩的 AI 爬虫引进一个没有尽头的链接迷宫。注意官方原话:AI 迷宫的动作不算拦截,请求本身不会被阻止或质询。想真挡住某家,还是用上面的拦截。 七、Workers:没有服务器的后端 Workers(Cloudflare 的 Serverless 函数)就是把一段 JavaScript 放到 Cloudflare 网络上跑,请求进来,代码执行,返回结果。接表单、调 API、返回动态数据都靠它。 免费版每天 10 万次请求,每次最多 10 毫秒 CPU。等网络请求返回的时间不算 CPU,官方给的平均值是每次 2.2 毫秒,所以一般的接口很难超。超了每天 10 万次会返回 1027 错误。你可以在路由里选 fail open(直接绕过 Worker,网站照常)或 fail closed(显示 1027 错误页)。 要存数据,有两个免费的: Workers KV 键值存储,适合配置、缓存、短链接,免费每天读 10 万次、写 1,000 次,共 1 GB。 D1 数据库(SQLite),适合留言、订单这种要查询的表,免费每天读 500 万行、写 10 万行,总共 5 GB,单个库最大 500 MB,一个账号最多 10 个库。 两样免费额度用完都是报错,不扣钱。 八、Workers AI:不买显卡跑开源模型 Workers AI 把一批开源模型放在 Cloudflare 的 GPU 上,Worker 直接调用,不用自己申请模型的 API Key。免费每天 10,000 Neurons(Cloudflare 自己的计量单位),付费版超出部分 0.011 美元每 1,000 Neurons。免费版用超了就报错。 有几个新模型必须付费才能用,官方点名的是 Kimi、GLM、DeepSeek 的几个型号,免费账号调不动。 步骤:新建一个 Hello World 的 Worker,在「绑定」里加 Workers AI,变量名填 AI(大小写要对上),再把代码换成下面这段。它照着官方入门文档的示例写,只把提问换成了中文: export default { async fetch(request, env) { const r = await env.AI.run("@cf/google/gemma-4-26b-a4b-it", { messages: [{ role: "user", content: "简单介绍一下 Cloudflare" }], chat_template_kwargs: { enable_thinking: false }, }); return Response.json(r); }, }; 模型用的是官方入门文档里的 Gemma 4。原作者实测一问一答 84 个 token,消耗 1.67 Neurons。 部署完那个免费子域名地址谁都能打开,打开一次耗一次额度。演示完在设置里关掉公开访问,或者直接删掉这个 Worker。 想管住调用量,可以在前面加一层 AI Gateway(AI 网关)。核心功能免费,包括分析面板、缓存和限速,免费版一个账号能建 10 个网关。 10 月 1 日 Cloudflare 还开源了两个决策模型 Clef 和 Clef-flash。它们不写长回答,只做选择题:给一段内容和几个选项(这条工单急不急、该转给哪个组),给每个选项打一个概率。Clef 基于 Qwen3.8-27B,64K 上下文,能看图,中位延迟 209 毫秒;Clef-flash 基于 Qwen3.5-9B,中位延迟 38.8 毫秒。Apache 2.0 协议,权重在 Hugging Face。在 Workers AI 上调用的模型 ID: @cf/cloudflare/clef @cf/cloudflare/clef-flash 九、交给 Agent:cf 命令行 9 月 28 日 Cloudflare 发了新命令行 cf,目前公开测试。官方博客给的数据:今年 3 月,Agent 发起的使用占老命令行 Wrangler 的四分之一,发布前一周涨到 48%。 Wrangler 能管的操作 280 个左右,cf 覆盖 Cloudflare API 的 3,000 多个操作,DNS、R2、邮件、安全设置都能管。Wrangler 不会马上没,公测结束后还会再维护 18 个月。 npm install --global cf cf auth login cf cli search "create D1 database" cf d1 create --name my-database --dry-run 装好以后 cf auth login 会弹浏览器让你确认授权。不知道命令就用 cf cli search 拿自然语言搜。改东西之前加 –dry-run,只打印将要发出的请求,不真执行,官方说 dry-run 连凭证都不需要。 最要小心的一点:Agent 自动跑的时候,删除命令没加 –force 会打印 Aborted. 然后退出码是 0。看着像成功,其实什么都没删。官方原话就是「退出成功不代表资源已被删除」,删完让 Agent 再查一次。 在用户级的 AGENTS 说明文件或 CLAUDE 说明文件里加一句官方推荐的话,Claude Code、Codex 这类 Agent 就知道优先用 cf: When interacting with Cloudflare, use the cf CLI unless the project has a Wrangler configuration file. 无人值守跑定时任务要用 API 令牌,只勾需要的权限和域名,设有效期,别写进代码仓库,也别贴进跟 AI 的对话。 十、防账单爆炸:开干之前先做这几件事 回到开头那张 10,811.41 美元的账单。他踩的是付费版里的 Durable Object,alarm 每触发一次都算一次请求,死循环一跑,按量计费没有上限地往上走。 我自己会按这个顺序防: 能用 Workers 免费版就别升级。免费版的 Workers、KV、D1、Workers AI 超额都是报错,最坏是接口停到第二天早上 8 点,静态页面照常能打开。 R2 是例外,超了就出账。只放图床和备份,自定义域上挂缓存和 WAF 规则,r2 开发地址用完就关。 真升级了付费版,第一件事去 计费 → 可计费用量 → 创建预算提醒,填一个美元金额。注意官方原话:预算提醒只发邮件,不暂停、也不封顶,而且只给按量付费(Pay-as-you-go)账户用。 定时任务、Durable Object alarm、队列这种会自己触发自己的东西,上线前给循环加次数上限,先本地跑,上线第一天盯着用量页看。让 AI 写的这类代码更要多看一眼。 付费版可以给每个 Worker 设 CPU 时间上限,默认 30 秒,最高 5 分钟,也能往低设,官方配置示例里写的就是 100 毫秒(cpu_ms)。每个 Worker 的子请求数也能单独限(subrequests)。 用不到的 Worker 直接删,公开的免费子域名地址演示完就关。 钱从哪扣,把官方文档拼起来就清楚了:免费版的 Workers、KV、D1、Workers AI,还有免费版能用的 Durable Objects,超额都是报错;R2 和 Workers 付费版都得先开订阅,开订阅前 Cloudflare 要求账号里先有有效付款方式。所以就这篇用到的服务来说,没开这两样订阅,就没有按量扣钱的入口。 官方文档 2026 年 10 月的版本为准,以后可能会调。 我自己哪天要把图床挪到 R2,会先建预算提醒,再传第一张图。
Author experienceContainers +2

gargantuaxdev: A Cloudflare Containers idle-billing warning; the author therefore moved the site to a VPS

On 2026-11-23, X user @gargantuaxdev (GargantuaX | Gx) writes: shipwords v0.3.0 moved from Cloudflare Workers to a VPS. The author says a video site cannot do without ffmpeg, Workers cannot run it, so the only option is Cloudflare Containers, but “it has an idle-billing problem the official team has never fixed, and a little inattention may mean a 上千元 bill.” The author also says that once the site scales up, D1 also has transaction and concurrency problems, and says “CF Workers saves hassle, but not money,” and therefore switched to a cheaper, longer-term VPS setup. The body is complete. “The official team has never fixed it” and “may be 上千元” are the author’s warning, not an official admission, and not an invoice amount.

Other

itsabhisheksood: a Cloudflare 3D Secure prompt asked to confirm a $275.68 monthly payment.

X user @itsabhisheksood (Abhishek Sood) posted a screenshot of a Cloudflare 3D Secure prompt asking to confirm a $275.68 payment, with the caption “A vibe coding mishap or something big in the making?” The prompt describes a monthly payment. X user @thisnaeem replied calling it a $275.68 monthly Cloudflare bill and asking whether an agent provisioned something or usage compounded. The product and cause are not stated. The public outcome is unknown.

Community resourceAccount-wide usage-based products

PennyBar: a macOS menu bar for Cloudflare and other usage-billed services

An open-source macOS menu bar app that shows this billing period's spend across Cloudflare, Vercel, Railway, Neon and PlanetScale, with total and per-account budgets.