Documentation/Getting Started/Overview
v0.3.0 Release

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:

app/api/chat/route.ts
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

Live Math
Input Tokens (Prompt)1,500 tokens
Output Tokens (Completion)600 tokens
Reasoning / Thinking Tokens300 tokens
Markup Multiplier (Profit Margin)1x (0% margin)
Computed Inference Cost
$0.000585USD
Input Prompt Cost:$0.000225
Output & Thinking Cost:$0.000360
Raw Base Cost:$0.000585
Calculated synchronously in 0.00ms with zero external API calls.

Zero-Database React Suite

Real-time client telemetry and paywalls without requiring any backend database queries:

Interactive Component Sandbox

Live Session Telemetry Preview

Look at the floating card below to inspect the real-time <VibezSessionWidget />!

Active Session
3 turns
Session Cost
$0.0042
Tokens Used
1,450

Ready to start metering?

Install the SDK or run the 10-second setup wizard in your terminal.

Next.js Quickstart