On this page
01
What you'll set up
Cost per token is not what your business buys. In about twelve minutes you will measure AI cost per resolved ticket, per call, or per customer, and connect it to the value that work creates.
- A unit that matches how your business counts work
- Requests tagged with that unit
- Cost per unit by team, app, and more
- A value per outcome, so you can read ROI and net value
- A showback export for finance
02
Pick units your business already counts
The best unit is one a budget owner recognizes. Pick the outcome the AI produces, not the call it makes.
| Team | A good unit |
|---|---|
| Support | Resolved ticket |
| Sales | Qualified lead |
| Operations | Processed document |
| Voice | Handled call |
03
Define a unit
A unit is the thing you count. Defining it tells Economics how to report it.
- 1
Open Economics
Go to AI → Economics.
- 2
Choose Add or Edit Unit
This opens the unit form.
- 3
Name it
Enter a Display Name, such as Payments resolved, and a Metric Slug / Event Key, such as payments_resolved. Both are required.
- 4
Choose Match Spend By
Pick how spend is matched to the unit: Product, Team, App, Environment, Cost center, Feature, or a custom label.
- 5
Choose Reporting Granularity
Pick how often the unit is reported.
- 6
Save
The unit appears under Business Units, and fills in as requests carry it.
- 3Display Name *
- Payments resolved
- 3Metric Slug / Event Key *
- payments_resolved
- 4Match Spend By
- Product
- 5Reporting Granularity
- daily
04
Tag requests with the unit
Send the unit on each request as headers. Set the type to your unit's slug.
curl https://api.cloptima.ai/v1/ai/chat/completions \
-H "Authorization: Bearer $CLOPTIMA_VIRTUAL_KEY" \
-H "X-Cloptima-Team: support" \
-H "X-Cloptima-App: support-assistant" \
-H "X-Cloptima-Business-Transaction-Type: payments_resolved" \
-H "X-Cloptima-Business-Transaction-Id: ticket-48213" \
-H "X-Cloptima-Business-Transaction-Unit-Count: 1" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "Summarize this ticket"}]}'| Header | What it carries |
|---|---|
| X-Cloptima-Business-Transaction-Type | The unit slug |
| X-Cloptima-Business-Transaction-Id | Your id for this unit of work |
| X-Cloptima-Business-Transaction-Unit-Count | How many units this request counts for |
| X-Cloptima-Business-Outcome-Success | Whether the work succeeded |
| X-Cloptima-Business-Value-Cents | Optional revenue or value, in cents |
05
Tag from an SDK
If you call providers directly and report usage with an observability SDK, pass the same fields on the call.
import { extractOpenAIUsage, initFromEnv } from "@cloptima/llm-observability";
const cloptima = initFromEnv();
const result = await cloptima.observeCall({
provider: "openai",
model: "gpt-4.1-mini",
call: () => supportAssistant.reply(ticket),
extractUsage: extractOpenAIUsage,
featureId: "ticket_reply",
businessTransactionType: "payments_resolved",
businessTransactionId: ticket.id,
businessTransactionUnitCount: 1,
});The Python SDK takes the same fields in snake case, such as business_transaction_type.
06
Send counts directly
If the work happens outside the gateway, use Direct Ingestion, or call the same endpoint from a pipeline.
| Field | What to enter |
|---|---|
| Select Denominator Metric | The unit you defined |
| Total Unit Count | How many units were produced. Required |
| Successful Outcomes and Failed Outcomes | How many succeeded and failed |
| Revenue Generated (USD) | Optional revenue for the window |
| Timeframe Start and End | The window the counts cover |
The API / Integration Guide tab generates a ready-to-run request for the unit you pick.
07
Read cost per unit
Business Units shows each unit with its spend, units, success rate, and value. Open a unit to split cost per unit by team, app, and other dimensions.
| Column | Meaning |
|---|---|
| Spend | AI spend matched to the unit |
| Total units | Units produced in the window |
| Cost / unit | Spend divided by units |
| Revenue / unit and Margin / unit | Value per unit and what is left after AI cost |
| Success | Share of units that succeeded |
| Bucket | Spend | Units | Cost / unit |
|---|---|---|---|
| support-assistant | $1,920 | 16,000 | $0.12 |
| billing-assistant | $1,350 | 4,500 | $0.30 |
08
Know how cost was assigned
Each row says how its cost was assigned, so you know how far to trust it.
| Label | Meaning |
|---|---|
| Directly tagged | Every request had complete team and app labels, so the cost was assigned directly |
| Partially estimated | Some usage was untagged and was split in proportion to the tagged usage |
| Unallocated | No labels were present, so the cost is reported as shared |
09
Calibrate the value of an outcome
To read ROI, tell Cloptima what one successful outcome is worth. Use Calibrate ROI on the Economics tab.
| Step | What to enter |
|---|---|
| Transaction type | The unit slug, such as payments_resolved |
| Value & baseline | The value of one success, and the cost of the same work before AI (optional) |
| Owner & dates | Who owns the figure, and the period it covers |
| Review & save | Check and save |
Economics then shows Cost Avoided (ROI), Revenue Booked, and Net Value, which is cost avoided plus revenue booked minus spend.
11
Roll out in steps
Start with one unit and one workload.
- 1
Define one unit
Choose the workload that spends the most.
- 2
Tag a single app
Add the headers in that app's client.
- 3
Check the allocation labels
Aim for Directly tagged.
- 4
Calibrate its value
Add the value of one success.
- 5
Add the next unit
Repeat for the next workload.