Skip to content

[Admin][API] Cloudflare billing-actuals for authoritative platform AI spend #45

Description

@serge-ivo

Follow-up from #32 (PR #43). Token estimates are derived; the authoritative platform Workers-AI cost is Cloudflare's. Pull real neuron spend from Cloudflare GraphQL Analytics / billing API and surface it as the headline platform-spend number, with per-figure source: "cf-actuals" | "estimate". Cache the pull (rate-limited/slow).

Infra: the API worker has NO CF creds bound today (workers/api/wrangler.toml) — add CLOUDFLARE_API_TOKEN (Analytics read scope) + CLOUDFLARE_ACCOUNT_ID as secrets/vars (Doppler pags/prd already has both).

Part of the PAGS Admin Portal epic (#27). Pairs with the ledger metering follow-up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    admin-portalPAGS admin/operator portalenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions