All guides

Track AI Cost per Ticket, Call, or Customer

Define a business unit, tag requests with it, calibrate its value, and read cost per unit, margin, and net value.

12 min read Updated October 2026LLM FinOps
On this page
  1. 01What you'll set up
  2. 02Pick units your business already counts
  3. 03Define a unit
  4. 04Tag requests with the unit
  5. 05Tag from an SDK
  6. 06Send counts directly
  7. 07Read cost per unit
  8. 08Know how cost was assigned
  9. 09Calibrate the value of an outcome
  10. 10Share it with finance
  11. 11Roll out in steps

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.

TeamA good unit
SupportResolved ticket
SalesQualified lead
OperationsProcessed document
VoiceHandled call

03

Define a unit

A unit is the thing you count. Defining it tells Economics how to report it.

  1. 1

    Open Economics

    Go to AI → Economics.

  2. 2

    Choose Add or Edit Unit

    This opens the unit form.

  3. 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. 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. 5

    Choose Reporting Granularity

    Pick how often the unit is reported.

  6. 6

    Save

    The unit appears under Business Units, and fills in as requests carry it.

AI → Economics → Add or Edit Unit
3Display Name *
Payments resolved
3Metric Slug / Event Key *
payments_resolved
4Match Spend By
Product
5Reporting Granularity
daily
Save Settings
A name and a slug are all you need to start.

04

Tag requests with the unit

Send the unit on each request as headers. Set the type to your unit's slug.

bash
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"}]}'
HeaderWhat it carries
X-Cloptima-Business-Transaction-TypeThe unit slug
X-Cloptima-Business-Transaction-IdYour id for this unit of work
X-Cloptima-Business-Transaction-Unit-CountHow many units this request counts for
X-Cloptima-Business-Outcome-SuccessWhether the work succeeded
X-Cloptima-Business-Value-CentsOptional 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.

typescript
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.

FieldWhat to enter
Select Denominator MetricThe unit you defined
Total Unit CountHow many units were produced. Required
Successful Outcomes and Failed OutcomesHow many succeeded and failed
Revenue Generated (USD)Optional revenue for the window
Timeframe Start and EndThe 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.

ColumnMeaning
SpendAI spend matched to the unit
Total unitsUnits produced in the window
Cost / unitSpend divided by units
Revenue / unit and Margin / unitValue per unit and what is left after AI cost
SuccessShare of units that succeeded
BucketSpendUnitsCost / unit
support-assistant$1,92016,000$0.12
billing-assistant$1,3504,500$0.30
Example, for illustration

08

Know how cost was assigned

Each row says how its cost was assigned, so you know how far to trust it.

LabelMeaning
Directly taggedEvery request had complete team and app labels, so the cost was assigned directly
Partially estimatedSome usage was untagged and was split in proportion to the tagged usage
UnallocatedNo 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.

StepWhat to enter
Transaction typeThe unit slug, such as payments_resolved
Value & baselineThe value of one success, and the cost of the same work before AI (optional)
Owner & datesWho owns the figure, and the period it covers
Review & saveCheck and save

Economics then shows Cost Avoided (ROI), Revenue Booked, and Net Value, which is cost avoided plus revenue booked minus spend.

10

Share it with finance

Export a showback CSV from Economics for budget owners, or the FOCUS export from the Explorer for finance tools.

  • Showback CSV: cost per unit by team or app
  • FOCUS CSV: the full cost and usage ledger

11

Roll out in steps

Start with one unit and one workload.

  1. 1

    Define one unit

    Choose the workload that spends the most.

  2. 2

    Tag a single app

    Add the headers in that app's client.

  3. 3

    Check the allocation labels

    Aim for Directly tagged.

  4. 4

    Calibrate its value

    Add the value of one success.

  5. 5

    Add the next unit

    Repeat for the next workload.

Put This Guide Into Practice

Cloptima automates the strategies described in this guide.

No credit card required
5-minute setup
Free trial