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.
01 / REQUESTRecorded example
Summarize a support ticket
02 / RECEIPTUSD · LIST PRICE
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();