mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-07-10 01:29:41 +00:00
Opt-in Vercel AI Gateway provider (AI_GATEWAY_API_KEY/VERCEL_OIDC_TOKEN), inert without a key. Cursor lookback now period-aligned with a 6-month floor. Gateway fetch hardened on merge with an 8s timeout and try/catch fallback.
1.3 KiB
1.3 KiB
Vercel AI Gateway
Cloud usage for Vercel AI Gateway via the reporting API.
- Source:
src/providers/vercel-gateway.ts - Loading: lazy (
src/providers/index.ts) - Test:
tests/providers/vercel-gateway.test.ts
Where it reads from
Not local disk. CodeBurn calls:
GET https://ai-gateway.vercel.sh/v1/report?start_date=...&end_date=...&date_part=day&group_by=model
See Custom Reporting.
Authentication
Set one of:
AI_GATEWAY_API_KEYVERCEL_OIDC_TOKEN(fromvercel env pullwhen usingvercel dev)
Caching
None. Each parse issues one API request for the requested date range.
Deduplication
Per vercel-gateway:<day>:<model>.
Quirks
- Requires Pro/Enterprise Custom Reporting on your Vercel account.
- Data can lag by a few minutes after requests complete.
- Rows are daily aggregates per model, not per chat session.
total_costis used ascostUSD; token fields map directly when present.
When fixing a bug here
- Confirm env vars are set in the same shell running
codeburn. - Reproduce with
codeburn report --provider vercel-gateway -p week --format json. - Compare totals to the Vercel dashboard AI Gateway usage view.