Next.js starter app
Dashboard, routes, setup docs, environment validation, and a focused demo workflow.
A source-code Next.js starter for paid AI apps. Add an internal usage layer, workflow-level cost tracking, soft caps, billing snapshots, and admin visibility before margins break.
customer, workflow, model, entitlement snapshot, retries, final outcome
The first version is designed to be practical source code, not a separate SaaS service. Drop it into a paid AI app and route model calls through one controlled boundary.
Dashboard, routes, setup docs, environment validation, and a focused demo workflow.
One typed client for model calls, provider routing, retries, caps, and outcome logging.
Self-contained records for customer, workflow, cost, price ID, entitlement, and final outcome.
Workflow cost, retry spend, failed runs, outlier users, plan usage, and margin leakage.
Plan snapshots, soft caps, upgrade prompts, and reconciliation-friendly event records.
Setup guide, architecture notes, buyer license, and clear limits for included support.
Most teams notice the problem after launch: outlier users, retries, context spikes, failed runs, and billing records that do not explain what happened.
Token counts explain provider cost. They do not tell you whether the user received a valuable outcome.
Agentic workflows can spend heavily on failed or retried runs before anyone checks the dashboard.
If plan state is looked up later, upgrades and changing limits make reconciliation unreliable.
Start inside the app, but keep the boundary shaped like a gateway so it can become a relay later.
customer, workflow, environment, price ID, entitlement snapshot
soft limits, context windows, model allowlists, hard risk blocks
provider keys stay behind one internal client
tokens, cost, latency, retries, failures, final outcome
see workflow cost, usage by plan, and quiet margin leaks
The template should feel like a normal Next.js app, but every provider call must pass through a typed usage boundary that records cost and outcome.
await aiUsage.run({
customerId,
userId,
workflow: "pdf_question",
feature: "rag",
environment: "production",
entitlement: planSnapshot,
caps: {
maxContextTokens: 12000,
softDailyCost: 4.00
},
action: async ({ model }) => {
return streamAnswer({ model, question, chunks })
}
})
The buyer should not have to redesign billing architecture from scratch. The template gives them a working pattern they can adapt.
Call aiUsage.run() from product workflows instead of calling providers directly.
Log tokens, retries, provider cost, failed runs, usable result, and plan snapshot.
Use soft caps, workflow dashboards, and billing snapshots to catch margin leaks early.
Track retrieval, context windows, file caps, and cost per answered question.
Measure resolved tickets, retries, failed runs, fallback spend, and plan limits.
Price reports by completed output while tracking model mix and retry leakage internally.
Reuse a client-ready pattern for billing, caps, admin visibility, and handoff docs.
Keep the customer-facing plan simple: reports, documents, tickets, runs. Internally, track the cost and margin behind every unit.
Every event stores customer, workflow, model, tokens, cost, retries, outcome, price ID, and entitlement snapshot.
Dashboard views by workflow, model, customer, retry spend, failed runs, and plan usage.
Warnings and upgrade prompts before hard blocks, unless cost risk is genuinely dangerous.
Prompt and body logging stay off by default. Cost metadata remains useful without sensitive content.
Events are self-contained enough to re-derive charges after plan changes and mid-cycle upgrades.
One internal AI client today, clean extraction path to relay/gateway later.
Joining early access is free and does not create a purchase or reserve a price. These ranges test pricing expectations for the future source-code release.
Planned first paid release for early builders who help shape V1.
For indie hackers building paid AI apps.
For client projects and repeat delivery.
No. It includes SaaS foundations where needed, but the product focuses on AI usage accounting, cost caps, billing snapshots, and workflow profitability.
Not in V1. It starts as app-level middleware with a gateway-shaped boundary so it can be extracted later.
No. Users see simple units like reports, documents, tickets, or runs. Owners see internal cost and margin by workflow.
Prompt/body logging is off by default. The ledger records metadata for cost, reliability, caps, and billing audits.
Join the early list if you want the first working demo, beta access, or want to help shape the usage layer before V1 ships.