Overview
The declarative, 1-line Stripe Billing and Token Metering engine for LLMs and the Vercel AI SDK. Track tokens, extract reasoning thoughts, compute USD costs, and bill customers with 0ms added latency.
0ms Added Latency
Streams pass straight to browser with zero proxy delay or middleware buffering.
Reasoning Token Aware
Accurately bills hidden thinking tokens in GPT-5, o3-mini, Claude 3.7, and DeepSeek R1.
Agent Circuit Breakers
Automatic budget guardrails (maxCostPerCallUSD) prevent runaway loops.
The 1-Line Standard
Wrap any model string or provider instance directly into your Vercel AI SDK call:
import { streamText } from 'ai';
import { vibezcheck } from 'vibezcheck';
export async function POST(req: Request) {
const { messages, customer = 'alex@example.com' } = await req.json();
// ⚡ 1-Line Declarative Model Metering
return streamText({
model: vibezcheck('openai/gpt-4o-mini', {
customer, // Auto-provisions Stripe customer
maxCostPerCallUSD: 0.20, // Guardrail ceiling
onUsage: (event) => {
console.log(`⚡ [vibezcheck] Tokens: ${event.usage.totalTokens} | Cost: $${event.cost.totalUSD.toFixed(6)}`);
},
}),
messages,
}).toTextStreamResponse();
}Live Token & Cost Economics
Test token pricing across models and configure profit margins in real time:
Interactive Model Cost Calculator
Live USD inference cost estimation across 50+ models
Zero-Database React Suite
Real-time client telemetry and paywalls without requiring any backend database queries:
Live Session Telemetry Preview
Look at the floating card below to inspect the real-time <VibezSessionWidget />!
Ready to start metering?
Install the SDK or run the 10-second setup wizard in your terminal.