Why Costr
Most teams track total AI spend in their billing dashboard. That number tells you nothing useful. Costr tells you which customers are expensive, which features drive the bill, and whether any of it is profitable.
What it is
Costr is a transparent proxy that sits between your app and your AI providers — OpenAI, Anthropic, and Google. Every API call passes through it unchanged. What Costr adds is attribution: it records how many tokens each call used, converts that to dollars using live pricing, and ties it back to the customer ID or feature tag you passed in the header.
No prompt content is stored. No model outputs are logged. Costr only sees token counts, model names, and the metadata you explicitly provide. Your data stays between you and your provider.
The result is a dashboard that answers the question every AI product team eventually hits: “Which of our customers is costing us the most — and are we making money on them?”
How it works
Change baseURL in your OpenAI, Anthropic, or Google client to costr.dev/api/proxy/…. Your existing code keeps working — same models, same responses, same latency.
Add an x-costr-user header with your customer’s ID. Optionally add x-costr-feature to track spend by product feature (e.g. “summarize”, “chat”).
Your Customers page shows spend per customer, sorted by cost. Add revenue manually, via CSV, or by connecting Stripe — and Costr calculates gross margin on every row.
const openai = new OpenAI({ baseURL: 'https://costr.dev/api/proxy/openai', defaultHeaders: { 'x-costr-key': process.env.COSTR_KEY, 'x-costr-user': customer.id, // ← this is all Costr needs } })
What you get
Six views, all connected. From raw token counts to customer-level gross margin.
See exactly how many dollars each customer has cost you this month, which providers they're hitting, and whether their spend is trending up.
Add each customer's MRR manually, via CSV upload, or via Stripe sync. Costr subtracts their AI spend and shows you margin — positive or negative.
Tag calls with x-costr-feature ("chat", "summarize", "search"). See which features in your product are the most expensive to run.
OpenAI, Anthropic, and Google normalized to dollars. No switching between billing dashboards — one view across all three.
Based on daily run rate, Costr projects where your total spend will land by month-end — so you're not surprised on the 31st.
Costr never stores prompt content or model responses. Only token counts, model names, and the metadata you explicitly send.
Privacy by design
Costr observes the shape of your AI traffic — model name, token usage, timestamp — and nothing else. Your prompts, your users’ messages, and model responses pass through the proxy but are never read, stored, or logged.
You pay your provider directly. Costr charges for the dashboard, not the inference. Your provider relationship, your keys, your data.
BYOK is required — you bring your own OpenAI, Anthropic, or Google key. Costr never holds a shared pool key, never marks up inference costs, and never blocks your calls if you hit a tracking cap. We see the bill shape; we don’t pay it.
Who it’s for
How we compare
Helicone and Langfuse are great observability tools. They’re not built for per-customer financial accounting.
| Feature | Costr | Helicone | Langfuse | Build it yourself |
|---|---|---|---|---|
| Per-customer spend attribution | ✓ | — | — | weeks of work |
| Revenue + gross margin per customer | ✓ | — | — | more weeks |
| Feature-level cost breakdown | ✓ | — | ✓ | manual tagging |
| OpenAI + Anthropic + Google in one view | ✓ | ✓ | ✓ | 3× integrations |
| Zero prompt data stored | ✓ | — | — | depends |
| End-of-month spend projection | ✓ | — | — | — |
| Stripe revenue sync | ✓ | — | — | separate build |
| One-line integration | ✓ | ✓ | — | — |
Free to start. No credit card. One line of code and your first attribution shows up in under a minute.