Build vs buy · AI cost tracking
A token counter takes a day. Cost per customer that stays right is a product.
Before you build AI cost tracking in-house, here is the work it takes to know what each customer costs against what they pay, and what it costs to keep that number right.
What you would build
Seven parts, and none of them is the dashboard.
- 01
A price catalog that stays current
165 models from 9 providers, 191 dated price versions. Prices change on announced dates, and last month's calls must keep last month's price.
3 price changes and 20 model shutdowns are scheduled now → - 02
Token rules for each provider
Cache reads and 5-minute or 1-hour cache writes, Batch, Flex and Priority tiers on 69 models, long-prompt rates on 17, and thinking tokens billed as output. Each provider reports usage differently.
- 03
Capture without double counting
SDK wrappers, a REST API or OpenTelemetry, and event IDs that make retries and replays safe. Failed calls still cost money and need to show up.
- 04
Attribution to customers and work
Customer, plan, workflow and feature on every call, and multi-step agent runs with MCP tool calls joined into one execution.
- 05
A join to what customers pay
Subscriptions, credit packs counted at the price paid, top-ups, refunds and currencies, matched to the same customer IDs as the usage.
- 06
Corrections and history
Fixing a bad event without losing the original, repricing history when a rate was wrong, and an audit trail of who changed what.
- 07
Reports people act on
Margin by customer, plan and workflow, the cause when a customer goes negative, budgets and alerts, and the month-end AI spend close.
Your numbers
What would building cost you?
Move the sliders to your own estimates. The starting values are examples, not benchmarks.
Engineering time only, at your own rates. It leaves out hosting, on-call and what the team could have shipped instead.
Side by side
Five things to weigh.
An honest answer
When building is the right call.
Ganivra is not the answer for every team. Build, or use what you already have, when:
- You only need total spend. Your provider's dashboard and invoice already show it.
- Usage data cannot leave your infrastructure. Ganivra receives usage metadata, never prompts, but it is a hosted service.
- Metering is your product. If you sell billing or metering, own it end to end.
- One model, one provider, one flat price. A provider usage export and a spreadsheet may be enough for now.
Questions
Build vs buy FAQ
How long does it take to build AI cost tracking in-house?
Multiplying tokens by a price takes a few days. Cost and margin per customer that stays correct is longer: a dated price catalog, provider-specific token rules, attribution, a join to revenue and reports. Put your own estimate into the calculator above; most of the cost is in keeping it accurate after launch.
Is there anything we should still build ourselves?
Yes: the customer and workflow IDs your app sends with each call. Only your application knows who a call was for. Ganivra prices the call and joins it to what that customer pays.
Does Ganivra replace our observability tool?
No. Tools such as Langfuse, Helicone and Datadog show what ran. Ganivra shows what each customer costs against what they pay. Many teams run both.
Does Ganivra sit in our request path?
No. There is no proxy. Your app calls OpenAI, Anthropic or Gemini directly and sends usage to Ganivra afterwards, so an outage at Ganivra never blocks a model call.
We want to build. Can we use your price data?
Yes. The same prices Ganivra uses are published as JSON and CSV in the open llm-prices repository on GitHub under CC BY 4.0, including scheduled changes and shutdown dates.
See your own margin per customer before you decide.
Connect one workflow in an afternoon with the Python SDK, the REST API or OpenTelemetry. 14-day free trial, no credit card, from $29 a month after.