Skip to main content
The Narev SDKs make billing for AI easy. They handle the hard parts—capturing token usage, resolving live model prices, and routing structured billing events to your destination—so you can focus on building your product.

@ai-billing

@ai-billing is the SDK for Vercel AI SDK-based applications. It slots in as middleware, intercepts every model call, and emits billing events without requiring changes to your existing AI code.

Quick start

Install @ai-billing/core and emit your first billing event in under five minutes.

How it works

Understand the middleware pipeline: extractors, price resolvers, and destinations.

Destinations

Route events to Stripe, Lago, Polar.sh, OpenMeter, or build your own destination.

API reference

Full TypeDoc reference for @ai-billing/core and all official packages.
You can use @ai-billing standalone with any destination, or pair it with Narev Cloud to unlock FOCUS-format reporting and real-time AI price syncing.