Skip to content
Dashboard

Unified reporting for all AI Gateway usage

Link to headingHow a platform saved $80K

Link to headingImplement the reporting API

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'],
},
},
});

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'],
},
},
},
)

GET https://ai-gateway.vercel.sh/v1/report?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD

{
"results": [
{
"day": "2026-01-15",
"user": "customer_42",
"total_cost": 1240.00,
"market_cost": 1418.00,
"input_tokens": 4200000,
"output_tokens": 980000,
"cached_input_tokens": 1600000,
"cache_creation_input_tokens": 380000,
"reasoning_tokens": 520000,
"request_count": 8400
},
{
"day": "2026-01-15",
"user": "customer_87",
"total_cost": 185.00,
"market_cost": 211.50,
"input_tokens": 620000,
"output_tokens": 145000,
"cached_input_tokens": 210000,
"cache_creation_input_tokens": 48000,
"reasoning_tokens": 0,
"request_count": 1250
}
]
}