Add spend budgets to every end-user in your app. Block over-budget users automatically, show them your upgrade prompt, and watch spend in a live dashboard.
One power user can burn through your entire monthly OpenAI budget overnight.
OpenAI and Anthropic have no native way to set spending limits per end-user. It's all or nothing.
Building token counting, Redis counters, block logic, and a billing UI takes weeks.
Works with Next.js, Express, and plain Node.js
import { Nasca } from '@nasca/sdk'
const nasca = new Nasca({
accountId: process.env.NASCA_ACCOUNT_ID,
workerUrl: process.env.NASCA_WORKER_URL,
apiKey: process.env.NASCA_API_KEY,
getUserId: (ctx) => ctx.user.id,
getUserTier: (ctx) => ctx.user.plan, // 'Free', 'Pro', etc. — matches your tier names
})const callAI = nasca.wrap( openai.chat.completions.create.bind(openai.chat.completions) )
// Throws NascaBlockedError if user is over budget
const result = await callAI(
{ model: 'gpt-4o', messages: [...] }, // or 'claude-sonnet-4-6'
ctx
)Over-budget users get a NascaBlockedError with your custom upgrade message. Under the hood, Nasca checks Redis in under 50ms — your app never slows down.
Currently supports OpenAI and Anthropic Claude. More providers coming soon.
Priced by how many end-users you track. No per-request fees.
Built for indie developers who ship fast.
Get started free — no credit card required