// Provider invoice says spend jumped 38%
// Finance asks which feature caused it
const usage = await provider.billing.usage();
// Missing:
// - customer attribution
// - workflow margin
// - cost per outcome
// - budget owner
// - alert trail
AI cost tracking for TypeScript apps
Know which customers make or lose money
Margovia shows which customers, features, and workflows are driving AI spend before your OpenAI or Anthropic invoice surprises you
What needs attention
| Alert | Scope | Impact |
|---|---|---|
| Workflow spike | Executive weekly report | Critical |
| Margin watch | Churn Risk Co | Warning |
| Free usage | Free Workspace 12 | Info |
The problem
Provider dashboards tell you spend went up. They do not tell you why
Margovia turns raw model usage into product economics: which workflow caused the spike, which customer owns it, which outcome justified it, and which accounts are actually profitable
const openai = margovia.openai(rawOpenAI);
await openai.chat.completions.create({
name: "support.reply_draft",
customerId: "workspace_123",
userId: "user_456",
customerPlan: { name: "startup", monthlyUsd: 89 },
outcome: "reply_sent",
request: { model: "gpt-5-mini", messages }
});
Capabilities
One cost layer for the whole AI surface
Start with tracking, then add customer attribution, budgets, anomaly alerts, and reporting as the product moves from experiments to production
Workflow economics
Track cost per run, cost per successful outcome, and the workflows carrying your AI bill.
RUNS · OUTCOMES · MODELSCustomer profitability
Connect AI usage to customers, plans, revenue, and outcomes so you know which accounts make money and which ones do not.
CUSTOMERS · PLANS · MARGINBudget guardrails
Create project, workflow, customer, and user budgets with alerts before provider spend gets out of hand.
BUDGETS · ALERTS · FORECASTSProvider cost breakdown
See OpenAI, Anthropic, model, token, and tool costs in one dashboard instead of reconciling invoices later.
OPENAI · ANTHROPIC · TOOLSSDK first tracking
Wrap provider calls, send customer context, and report outcomes from TypeScript with a small integration.
TS SDK · REST · API KEYSOperational alerts
Route margin, anomaly, and budget incidents to the people who own the workflow.
ANOMALIES · EMAIL · SLACKIntegration
Install the SDK, track a provider call, ship with cost context
Margovia works beside your existing provider client. Your provider keys stay in your backend. Margovia receives metadata, usage, cost, attribution, and outcomes.
import OpenAI from "openai";
import { Margovia } from "@margovia/sdk";
const margovia = new Margovia();
const openai = margovia.openai(new OpenAI());
await openai.chat.completions.create({
name: "reports.executive_weekly",
customerId: "workspace_123",
customerName: "Northstar Agency",
customerPlan: { name: "team", monthlyUsd: 249 },
outcome: "report_downloaded",
request: { model: "gpt-5-mini", messages }
});
curl -X POST https://api.margovia.com/v1/track \
-H "Authorization: Bearer $MARGOVIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "setup_check",
"customerId": "demo_customer",
"outcome": "api_key_verified",
"costs": [{
"provider": "margovia",
"model": "connectivity-check",
"costUsd": 0,
"status": "completed"
}]
}'
Use cases
Built for teams that need AI economics by customer
Whether you are selling AI features, running client work, or operating internal copilots, the missing layer is the same: cost tied to the customer or workflow that caused it
Know which customers make money
Tie provider spend to customer plans, seats, usage, and outcomes so unprofitable accounts show up before the bill does.
Bill clients for the work AI actually did
Attribute runs to customers and projects, export usage, and prove which automated workflows created the cost.
Ship AI features without painful bills
Set budgets around workflows, users, projects, and customers with alerts when a model or prompt starts drifting.
Pricing preview
Start with tracking. Add controls as usage grows.
Free
$0/moConnect a small project and review low volume usage in the dashboard.
- ✓ 1 project
- ✓ API key ingestion
- ✓ Basic cost and run views
- ✓ 10k tracked calls
Developer
$29/moTrack real AI cost and customer margin while validating the product.
- ✓ API keys and SDK ingestion
- ✓ Customer and workflow economics
- ✓ Budget alerts
- ✓ 1M tracked calls
Startup
$99/moProduction visibility for teams watching cost, margin, and incidents.
- ✓ Everything in Developer
- ✓ Unlimited tracked events
- ✓ Weekly reports
- ✓ 365 days history
Questions
The things AI teams ask before adding a cost layer
Is Margovia another LLM proxy?
No. Margovia tracks cost and attribution around the provider calls you already make. You can use SDK wrappers or send cost events through the REST API.
Does it need our OpenAI or Anthropic keys?
No. Your provider keys stay in your app. Margovia receives run metadata, usage, cost, customer attribution, and outcomes
Can it track revenue and customer plans?
Yes. Send a customer ID and optional plan data with a tracked run, then adjust revenue and margin assumptions in the dashboard.
What happens when a budget is crossed?
Margovia creates alerts for budgets, anomalies, and margin risk. Enforcement modes can be added later behind explicit opt in.
Free AI cost review
Find the customers, features, or workflows putting margin at risk
Show us your provider usage, a CSV export, or just walk us through your current setup. We will help identify where AI spend is hiding and what to instrument first
Get started
Stop treating AI cost like a mystery invoice
Get a free review first, or create a project if you already know you want AI cost tracking by customer