ai-cost-per-user

LLM spend attribution for multi-tenant SaaS

Built for AI SaaS teams

Track LLM token costs per user and tenant before one customer drains your margin.

ai-cost-per-user sits between your app and LLM providers, logs every call with user attribution, and shows exactly who is burning API budget. Set hard limits, justify overages, and keep gross margin predictable.

Why teams buy this

Multi-tenant AI products need spend attribution as early as they need usage analytics.

Identify the exact users and tenants driving 80% of token spend.

Prevent one enterprise tenant from silently consuming shared model budget.

Back your overage billing with per-request cost evidence.

The Problem

LLM bills arrive aggregated, not attributed.

You know total spend but cannot map cost to customer accounts. That blocks usage caps, profitability analysis, and overage invoicing.

The Solution

Proxy + tracking middleware with tenant context.

Route calls through `/api/proxy/:provider/*` with `x-user-id` and `x-tenant-id`. We record tokens, model, endpoint, and dollar cost for each request.

The Result

Usage economics become manageable.

You can spot spend anomalies quickly, enforce quotas for expensive tenants, and protect gross margin while scaling AI-heavy workflows.

Integration Snapshot

Drop-in proxy pattern for your backend.

await fetch("https://your-domain.com/api/proxy/openai/v1/chat/completions", {
  method: "POST",
  headers: {
    "content-type": "application/json",
    "x-user-id": appUser.id,
    "x-tenant-id": appUser.tenantId
  },
  body: JSON.stringify({
    model: "gpt-4.1-mini",
    messages: [{ role: "user", content: "Summarize this account activity" }]
  })
});

What the dashboard reveals

Not just totals. Actionable attribution.

Daily token spend trend by tenant and user cohort.

Highest-cost users with per-call averages and last activity.

Recent requests for rapid debugging of cost spikes.

Simple Pricing

One plan for SaaS teams that need immediate cost attribution and budgeting visibility.

$29/month

  • Proxy middleware for OpenAI, Anthropic, Groq, and Gemini
  • Per-user and per-tenant token cost analytics
  • Webhook-driven paywall unlock with cookie access control
  • Export-ready request logs for billing and audits

FAQ

How does user attribution work?

Add `x-user-id` and `x-tenant-id` headers (or body fields) to each proxied request. The middleware captures those values with usage and cost metadata.

How does checkout unlock the dashboard?

Point your Stripe Payment Link success URL to `/purchase/success?session_id={CHECKOUT_SESSION_ID}`. The app validates that session from webhook events and sets an access cookie.

Can I use this for overage billing evidence?

Yes. Each request log includes user, tenant, model, token totals, estimated cost, and timestamp so you can support invoice line-items with traceable usage.

ai-cost-per-user | Track LLM spend by user and tenant