One endpoint for AI spend across all providers
Teams shipping AI features usually have plenty of usage data—it's just scattered. Provider consoles show only their own slice, and BYOK setups make it worse by spreading spend across whatever keys your users bring. The result is CSV exports, spreadsheet rebuilds, and after-the-fact bill reconciliation instead of real-time cost visibility.
Vercel's Custom Reporting API for AI Gateway, now in beta for Pro and Enterprise plans, addresses that by exposing cost, token usage, and request volume across all your gateway traffic—including BYOK requests—through a single programmatic endpoint.
What you can break down
The API lets you slice spend by model, provider, user ID, custom tag, or credential type. That means you can track costs per feature, per end customer, or per pricing tier from one place, and query it live via Claude Code.
Case study: simplifying a model aggregation platform
One AI platform aggregating models for over 200K users previously ran a separate proxy layer for cross-provider cost tracking. During the Custom Reporting private beta, they replaced that third-party proxy entirely, consolidating cost tracking and request management into one system and saving $80K+. With Advanced Reporting, they now use custom tags and user IDs to track customer usage and costs across models, getting programmatic spend data where their inference already runs.
Implementation
Start by tagging requests with user and tags so costs are attributable in terms your product and finance teams recognize. For customer-facing AI features, tag each request with the customer ID, their plan, and the feature they're using.
import { generateText } from 'ai';
const { text } = await generateText({
model: 'anthropic/claude-sonnet-4.6',
prompt: userMessage,
providerOptions: {
gateway: {
user: customer.id,
tags: [customer.plan, 'code-review', 'production'],
},
},
});
Tagging works with the AI SDK, Chat Completions API, Responses API, OpenResponses API, and Anthropic Messages API—regardless of interface or language, the data lands in the same reporting endpoint. Then query the custom reporting endpoint for answers:
GET https://ai-gateway.vercel.sh/v1/report?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD
Everything works across both BYOK and system credentials, whether users bring their own keys or you pay via AI Gateway credits. With the results you can:
- Track per-customer and per-feature costs to see where spend actually goes
- Monitor internal usage across models and providers to catch spikes early
- Set budgets, calculate margins, and make pricing decisions on real unit economics
completion = client.chat.completions.create(
model='anthropic/claude-sonnet-4.6',
messages=[{'role': 'user', 'content': 'Explain this error log.'}],
extra_body={
'providerOptions': {
'gateway': {
'user': 'ops-team-jane',
'tags': ['debugging', 'internal-tools'],
},
},
},
)
Because requests run through a single reporting endpoint, AI spend becomes just another production metric. Tag requests to match how your product works, query on a schedule, and use the data to set budgets, price features, and catch usage shifts before they become bill surprises.



