Break down spend by region
cloudcdn_costEstimate CloudCDN traffic costs over a 1–30 day window, returning per-region and total USD figures for FinOps questions and reporting.
Instructions
Estimate what CloudCDN traffic cost over the last N days, per region and in total, for FinOps questions. For energy and emissions use cloudcdn_carbon, which reads the same usage; for traffic without prices use cloudcdn_insights_summary. Asks GET /api/billing/usage for per-region requests and bytes first; cloudcdn.pro has no such endpoint today and answers 404, so the usage normally comes from the account totals of GET /api/core/statistics (Summary.TotalRequests and Summary.TotalBandwidth) as a single region named "global", with no split by region; projected=true skips the billing call. With zone set, the statistics narrow only the request count to that zone, and bandwidth stays account-wide. Prices are always computed locally from the published rate card, $0.20 per million requests plus $0.05 per GB. Returns JSON: days, mode ("actual" from billing usage, "projected" from statistics), regions (each with region, requests, bandwidth_gb and cost_usd, rounded to cents) and total_usd. When the billing call is not answered with 2xx, a line naming its HTTP status follows the JSON. Read-only. Fails: no CLOUDCDN_ACCOUNT_KEY, a JSON-RPC error; days outside 1..30, exit code 64; statistics without those totals, exit code 69, instead of reporting zero usage.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "cloudcdn_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Look-back window in days, 1 to 30. Default 7. | |
| zone | No | Zone to restrict usage to, usually a project from cloudcdn_assets, e.g. "acme"; passed to both endpoints as is (the statistics narrow only requests). Omit for every zone. | |
| projected | No | true to skip /api/billing/usage and project from /api/core/statistics. Default false. |