{
  "schema_version": "0.1",
  "name": "cf-free-tier",
  "description": "Cloudflare Workers + D1 free-tier wall predictor: which quota hits first, approx day under growth, and paid ($5 Workers + D1) monthly bill. Optional unindexed-table → rows-read helper.",
  "homepage": "https://dev.luling.xyz/cf-free-tier/",
  "version": "0.1.0",
  "entrypoints": [
    {
      "name": "compute",
      "description": "Rank free-tier utilizations and estimate paid monthly bill.",
      "method": "GET",
      "url": "https://dev.luling.xyz/cf-free-tier/?requests={requests}&reads={reads}&writes={writes}&storageGb={storageGb}&growthPct={growthPct}&cpuMs={cpuMs}&daysPerMonth={daysPerMonth}&vpsUsd={vpsUsd}&format=json",
      "parameters": {
        "requests": {
          "type": "number",
          "required": true,
          "description": "Daily Workers requests"
        },
        "reads": {
          "type": "number",
          "required": true,
          "description": "Daily D1 rows read (scanned)"
        },
        "writes": {
          "type": "number",
          "required": true,
          "description": "Daily D1 rows written"
        },
        "storageGb": {
          "type": "number",
          "required": true,
          "description": "D1 storage used in GB (account total)"
        },
        "growthPct": {
          "type": "number",
          "required": false,
          "description": "Daily compound growth % for 'days until hit'"
        },
        "cpuMs": {
          "type": "number",
          "required": false,
          "description": "Avg CPU ms per request (paid CPU overage)"
        },
        "daysPerMonth": {
          "type": "number",
          "required": false,
          "description": "Days used to project monthly bill (default 30)"
        },
        "vpsUsd": {
          "type": "number",
          "required": false,
          "description": "Optional user-supplied VPS $/mo for comparison"
        },
        "format": {
          "type": "string",
          "enum": [
            "json"
          ],
          "description": "Return machine JSON"
        }
      },
      "response": {
        "status": "ok | error",
        "firstToHit": "object — id, label, utilization, daysUntilHit, summary",
        "quotas": "array of free-tier quota statuses",
        "paidMonthly": "object — workers, d1, total, optional vsVps",
        "limits": "embedded official numbers with verified date",
        "caveats": "array of strings"
      }
    }
  ],
  "notes": [
    "Limits verified 2026-10-17 from developers.cloudflare.com Workers/D1 pricing + limits pages.",
    "D1 free overages fail until UTC midnight since 2026-09-01.",
    "Workers Logs billing changes 2026-12-01 — re-verify then.",
    "No hardcoded VPS prices. Static page: format=json rendered by page JS."
  ]
}
