veqenAI cost starterView source ↗

NEXT.JS · VERCEL AI SDK · VEQEN

An AI response.
And its receipt.

See what one response costs, then what it means at scale. A small, open-source starting point for cost-aware AI products.

Summarize a support ticket

Fixed sample response and token counts. No inference, credentials or telemetry are sent. Change the model to compare list-price estimates.

Every token, accounted for.

Estimated cost per response—Run the example to see the estimate
Fresh input tokens
—
Cache-read tokens
—
Output tokens
—
Price-book version
—
Projected monthly inference—

A list-price estimate, not a provider bill. Retries, other infrastructure, discounts and credits can change the total. Model quality must be evaluated separately.

TAKE IT INTO YOUR PRODUCT

Keep the response.
Keep the cost visible.

Use the middleware to record real usage. Add a send-only key when you want costs grouped by customer, feature or agent run in Veqen.

Open your cost ledger ↗
const model = wrapLanguageModel({
  model: openai("gpt-4o-mini"),
  middleware: {
    specificationVersion: "v3",
    ...veqen({ feature: "support" })
  }
});

await generateText({ model, prompt });
await flush();