{
  "version": "1.0.0",
  "title": "Billing integration (L1 cash paid)",
  "purpose": "Configure local L1 cash collection without publishing secrets. L1 is never inferred from L2 API-list tokens.",
  "setup": [
    "Copy config/billing.local.json.example → config/billing.local.json",
    "Set manual seatUsd/apiUsd per provider OR set CSV path / env (BTV_ANTHROPIC_BILLING_CSV, …)",
    "Optional: enable api.enabled + set key env vars (adapters stub until vendor APIs wired)",
    "Run: py -3 scripts/pipeline.py --since 2025-11-01",
    "Redeploy public/ to Pages"
  ],
  "envVars": [
    "BTV_BILLING_CONFIG",
    "BTV_ANTHROPIC_BILLING_CSV",
    "BTV_OPENAI_BILLING_CSV",
    "BTV_XAI_BILLING_CSV",
    "BTV_CURSOR_BILLING_CSV",
    "BTV_COPILOT_BILLING_CSV",
    "BTV_GOOGLE_BILLING_CSV",
    "ANTHROPIC_ADMIN_API_KEY",
    "OPENAI_ADMIN_KEY",
    "XAI_API_KEY"
  ],
  "providers": [
    "anthropic",
    "openai",
    "xai",
    "cursor",
    "github_copilot",
    "google",
    "other"
  ],
  "invariants": [
    "L1 cash paid ≠ L2 API-list",
    "Missing provider is residual, not $0",
    "Never commit billing.local.json or invoice CSVs",
    "Public estimate.json strips absolute paths and API keys"
  ],
  "scripts": {
    "collect": "public/scripts/collect_billing.py",
    "pipeline": "scripts/pipeline.py",
    "template": "config/billing.example.json"
  }
}
