Bismite is the billing runtime that lives in your code — and never takes your app down.
const access = await bismite.check(userId, "chat-message"); // gate
if (!access.allowed) return Response.json({ upgradeUrl: access.upgradeUrl }, { status: 402 });
// ...your expensive LLM call...
await bismite.record(userId, "chat-message", { tokens }); // meter
Drop it into your stack
Same SDK, same bismite.config — framework-agnostic. Gate before, meter after.
import { bismite } from "@/bismite.config";
export async function POST(req: Request) {
const { userId, message } = await req.json();
// GATE — before the expensive call
const access = await bismite.check(userId, "chat-message");
if (!access.allowed)
return Response.json({ upgradeUrl: access.upgradeUrl }, { status: 402 });
const reply = await callYourLLM(message);
// METER — after (you only know the cost once it returns)
await bismite.record(userId, "chat-message", { count: 1 });
return Response.json({ reply });
}
import type { NextApiRequest, NextApiResponse } from "next";
import { bismite } from "@/bismite.config";
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const { userId, message } = req.body;
const access = await bismite.check(userId, "chat-message"); // gate
if (!access.allowed)
return res.status(402).json({ upgradeUrl: access.upgradeUrl });
const reply = await callYourLLM(message);
await bismite.record(userId, "chat-message", { count: 1 }); // meter
res.json({ reply });
}
import express from "express";
import { bismite } from "./bismite.config";
const app = express();
app.use(express.json());
app.post("/chat", async (req, res) => {
const { userId, message } = req.body;
const access = await bismite.check(userId, "chat-message"); // gate
if (!access.allowed)
return res.status(402).json({ upgradeUrl: access.upgradeUrl });
const reply = await callYourLLM(message);
await bismite.record(userId, "chat-message", { count: 1 }); // meter
res.json({ reply });
});
Pricing
MTU = Monthly Tracked Users — the only billed meter. Calls are a fair-use ceiling, never billed.
Test traffic is isolated and never counts toward billing.
Create a project, copy your key, gate a feature in five minutes.
For developers building AI apps. npm install bismite