Back to RegistryUnified Cost Dashboard Plan (Docs-Verified Draft)
Objective
Build a single cost dashboard that tracks spend and usage across:
- LLM providers (OpenAI, Anthropic, OpenRouter, Google Gemini)
- Hosting/platform providers (Vercel, Cloudflare, WP Engine)
- Attribution targets down to app/site where possible
This plan is based on current provider docs/changelogs reviewed during this session.
1) Feasibility Matrix (by provider)
| Provider | Programmatic Cost/Usage Access | Granularity Confidence | Key/Auth Notes | Implementation Notes |
|---|---|---|---|---|
| OpenAI | Yes (Usage + Costs org endpoints shown in official cookbook examples) | High | Admin-level org key required for org usage/cost endpoints | Strong API path for time-bucketed costs and grouping |
| Anthropic | Yes (Usage & Cost Admin API) | High | Admin API key (sk-ant-admin...) required; not available for individual accounts | Excellent for org-level reconciliation and monitoring |
| OpenRouter | Partial-strong (generation-level usage/cost documented; account rollups less explicit) | Medium | Standard API key + generation IDs | Use per-request usage/cost and aggregate internally |
| Google Gemini API / AI Studio | Billing docs exist; programmatic export path depends on project/billing setup | Medium-low | Depends on AI Studio/Cloud Billing setup | Likely requires Cloud Billing export integration for robust reporting |
| Vercel | Yes (/billing/charges in changelog/API, FOCUS v1.3 stream) | High | Team token with billing access | Great source for FinOps-grade ingest |
| Cloudflare | Usage/billing docs available; usage-heavy per-service metrics; invoice remains source of truth | Medium | Account token with relevant scopes | Good for usage; cost allocation may need internal mapping model |
| WP Engine | API exists for platform/account ops; billing/overage data not clearly exposed as rich API in docs checked | Low-medium | Per-user API credentials | Likely combine API + portal export/manual feed initially |
2) Evidence Notes (docs checked)
- OpenAI usage/cost cookbook example includes
v1/organization/usage/completions and v1/organization/costs patterns.
- Anthropic docs explicitly provide a Usage & Cost Admin API and require admin keys.
- Vercel changelog (Feb 19, 2026) confirms
/billing/charges endpoint in FOCUS v1.3 format and CLI vercel usage.
- Cloudflare billing docs state usage-based billing and that invoice is most reliable source for billing info.
- WP Engine support docs confirm API focus is account/platform management and list many non-supported operations; billing API surface not clearly evidenced from reviewed pages.
3) Architecture Proposal
3.1 Data pipeline
- Ingestors per provider (scheduled)
- Normalize into one schema
- Attribution mapper (team/app/site/env/project)
- Cost calculator (when only usage is available)
- Dashboard/API layer
3.2 Core normalized schema
provider (openai, anthropic, openrouter, vercel, cloudflare, wpengine, google)
account_id
project_id / team_id
site_id (nullable)
service (model, workers, builds, etc.)
metric_type (usage|cost|credit)
quantity
unit
unit_price (nullable when direct cost exists)
amount_usd
period_start, period_end
source_confidence (high/med/low)
attribution_confidence (high/med/low)
3.3 Attribution model (critical)
- Prefer provider-native project/team tags first.
- Add internal mapping table:
- provider account -> FuelVM app -> client website
- Keep manual override support for ambiguous spend.
4) Security and access model
Use dual-plane model from fuelvm-access-matrix-v1.md:
- Internal plane: full ingestion and admin controls
- External plane: read-only client-facing cost slices
Token handling:
- Store provider keys in secret manager only
- Rotate quarterly (or on exposure)
- Separate read-only billing keys from write/admin keys where possible
5) Phased implementation
Phase 0 (1-2 days) — Validation Spike
- Validate live pull for: OpenAI, Anthropic, Vercel, Cloudflare
- Confirm exact scopes and retention windows
- Output: feasibility report with real sample rows
Phase 1 (1 week) — MVP Dashboard
- Providers: OpenAI + Anthropic + Vercel + Cloudflare
- Features:
- daily cost trend
- provider breakdown
- app/site attribution table
- anomaly alert thresholding
Phase 2 (1 week) — Expand connectors
- Add OpenRouter and Google path (direct or modeled)
- Add WP Engine via best available source (API/export hybrid)
Phase 3 (1 week) — Client-grade views
- Per-client/site rollups
- Budget vs actual
- Forecasting (7/30-day burn)
6) Known unknowns / risks
- OpenRouter account-level billing API depth vs per-generation reconstruction.
- Google AI Studio vs Cloud Billing export path for robust automation.
- WP Engine billing granularity via API appears limited from docs reviewed.
- Cross-provider timestamp normalization and FX/tax treatment (if needed).
Mitigation:
- Mark each data source with confidence tags.
- Separate “invoice-accurate” vs “estimated” views.
7) Immediate next steps (actionable)
- Create connector spike tickets for 4 high-confidence providers:
- OpenAI, Anthropic, Vercel, Cloudflare
- Define secret scopes per provider
- Stand up normalized
cost_events table
- Build first dashboard page:
- Total spend MTD
- Spend by provider
- Spend by app/site
- Confidence badges
8) Recommendation
Build this now as a staged FinOps product:
- It is feasible.
- Highest confidence starts with OpenAI/Anthropic/Vercel.
- Cloudflare and OpenRouter are viable with careful attribution.
- WP Engine and some Google paths may start as hybrid (API + export/model).
This is not pie-in-the-sky, it is a practical 3-phase build with clear early value.