cloudflare-cost-to-line: daily month-end cost forecasts sent to LINE
pych-ky’s MIT-licensed Worker sends the current month’s Cloudflare usage-based charges and a month-end forecast to LINE once a day or on demand, using the Billable Usage API.
- Products
- Workers
- Source
- Community resourceGitHub repository
- Author
- pych-ky
Key points
- Data: the README says it reads self-serve usage-based charges (USD, daily UTC line items) from Billable Usage API v1, which differ from the final amount paid including taxes, credits and invoice corrections.
- Forecast: charges so far plus the last 7 days’ average times the remaining days (including days not yet tallied) plus a configured monthly fixed cost. It holds the forecast back when data is missing, fewer than 7 days exist or the last 7 days were $0, and says free-tier overage, tiered pricing and sudden spikes cannot be forecast accurately.
- Setup: it deploys through GitHub Actions with separate tokens, a deploy token (Workers Admin at first, then Individual Workers Editor for that Worker) and a Billing Read token for charges, plus LINE Messaging API credentials. The default daily cron is 0 15 * * * (UTC) and the reporting time zone defaults to Asia/Tokyo.
- Delivery: temporary fetch failures are retried twice and then reported as an unconfirmed amount, and success means the LINE API accepted the message, not that it reached the device.
Original sources
Undated
cloudflare-cost-to-line: daily month-end cost forecasts sent to LINE
Open original sourcepych-ky’s MIT-licensed Worker sends the current month’s Cloudflare usage-based charges and a month-end forecast to LINE once a day or on demand, using the Billable Usage API.
More to read
A budget alert is a horn, not a brake
@GUYUE_LGY points to Cloudflare’s Budget alerts documentation: alerts send email when spend crosses a threshold but do not pause or cap usage. Before letting AI run unattended, the author checks what actually happens at the line.
wadwalekeshav2019: unexpected $26.83 invoice suspended the account.
Community user wadwalekeshav2019 reports unexpected invoice IN-80233960 for $26.83 that suspended the Cloudflare account for toolisky.com. The author says they did not intentionally subscribe to a paid service, traffic is relatively low, and asks Cloudflare to identify the service and review the charge.
cloudflare-cost-guard
Louis Cai’s open-source rules and TypeScript base class for keeping Durable Object alarms and Worker schedulers from runaway loops.