Cost per customer, to the cent
Every call can carry your own customer ID. Tovano records it with the task, so spend per customer comes from one API call, across image, video, audio, text and agent jobs.
Request
GET https://api.tovano.ai/v1/usage?group_by=customer&from=2026-11-01&to=2026-11-12
Authorization: Bearer $TOVANO_API_KEYResponse · GET /v1/usage, grouped by customer
Waiting for the run to finish.
{
"group_by": "customer",
"from": "2026-11-01",
"to": "2026-11-12",
"total_micro": 1899820,
"total_tasks": 10,
"data": [
{
"key": "client-0256",
"tasks": 2,
"failed": 0,
"charged_micro": 1021600
},
{
"key": "client-0482",
"tasks": 3,
"failed": 0,
"charged_micro": 752000
},
{
"key": "client-0117",
"tasks": 3,
"failed": 0,
"charged_micro": 66040
},
{
"key": "client-0930",
"tasks": 2,
"failed": 0,
"charged_micro": 60180
}
]
}Tasks
10 tasks
-
Completed $0.080
client-0482 · image/demo-1
tsk_ccd773f02aed · 4 images
-
Completed $0.00442
client-0117 · text/demo-chat-1
tsk_c378915fdafb · 2,900 in · 380 out tokens
-
Completed $0.054
client-0930 · audio/demo-tts-1
tsk_069d680e58ff · 1,800 characters
-
Completed $0.600
client-0482 · video/demo-1
tsk_ee681915ac7c · 6 seconds
-
Completed $0.0216
client-0256 · agent/ad-kit-1
tsk_b18c26441298 · copy + image
-
Completed $0.040
client-0117 · image/demo-1
tsk_880601e30409 · 2 images
-
Completed $0.00618
client-0930 · text/demo-chat-1
tsk_4b2a0f12e42e · 4,100 in · 520 out tokens
-
Completed $0.072
client-0482 · audio/demo-tts-1
tsk_31b78b9995df · 2,400 characters
-
Completed $1.00
client-0256 · video/demo-1
tsk_f618cd48b1f7 · 10 seconds
-
Completed $0.02162
client-0117 · agent/ad-kit-1
tsk_ecb9eab74173 · copy + image
Output
Events
- 0:00.0POST /v1/tasks · tagged calls from 4 customers
- 0:39.0tsk_ccd773f02aed completed · $0.080
- 0:42.0tsk_c378915fdafb completed · $0.00442
- 1:03.0tsk_069d680e58ff completed · $0.054
- 1:21.0tsk_880601e30409 completed · $0.040
- 1:33.0tsk_ee681915ac7c completed · $0.600
- 1:33.0tsk_b18c26441298 completed · $0.0216
- 1:33.0tsk_4b2a0f12e42e completed · $0.00618
- 1:45.0tsk_31b78b9995df completed · $0.072
- 2:15.0tsk_ecb9eab74173 completed · $0.02162
- 2:21.0tsk_f618cd48b1f7 completed · $1.00
- 2:27.0GET /v1/usage?group_by=customer · 4 customers
- 2:33.0Done · 10 tasks · $1.89982 charged
A played-back run with realistic requests, responses and charges. No API call is made and no key is used. Times are compressed.
Cost of this run
$1.89982 for 10 tasks
| Model | Usage | Amount | |
|---|---|---|---|
| Demo Image 1 image/demo-18 images × $0.020 / image | $0.160 | ||
| Demo Chat 1 text/demo-chat-17,780 input tokens × $1.00 / 1M input tokens | $0.00778 | ||
| Demo Chat 1 text/demo-chat-11,510 output tokens × $4.00 / 1M output tokens | $0.00604 | ||
| Demo Voice 1 audio/demo-tts-14,200 characters × $0.030 / 1K characters | $0.126 | ||
| Demo Video 1 video/demo-116 seconds × $0.100 / second | $1.60 | ||
| Total | $1.89982 |
Unit prices from the model catalogue, in US dollars, excluding tax. Agent jobs are charged per step at each step model's price.
Bill it back
Your margin, per customer
| Customer | Tasks | Your cost | You bill |
|---|---|---|---|
| client-0256 | 2 | $1.0216 | $1.32808 |
| client-0482 | 3 | $0.752 | $0.9776 |
| client-0117 | 3 | $0.06604 | $0.085852 |
| client-0930 | 2 | $0.06018 | $0.078234 |
| Total | 10 | $1.89982 | $2.469766 |
The figures come from the run above. In production, read them from /v1/usage for any date range.
How it works
Three calls you would write anyway.
- 1
Tag the call
Send X-Tovano-Customer, or the customer field, with any request. Your own ID scheme, up to you.
- 2
Read spend per customer
GET /v1/usage?group_by=customer returns tasks and spend per tag for any date range. Filter /v1/tasks by customer for the line items.
- 3
Bill it back
Apply your margin and add it to your own invoice. Failed tasks are never charged, so they never reach your customer's bill either.
The code
Copy it, add your key, run it.
The same request in curl, TypeScript and Python. The TypeScript client is tovano on npm.
# 1. Tag each call with your own customer ID curl https://api.tovano.ai/v1/tasks \ -H "Authorization: Bearer $TOVANO_API_KEY" \ -H "Content-Type: application/json" \ -H "X-Tovano-Customer: client-0482" \ -d '{ "model": "image/demo-1", "input": { "prompt": "Hero banner, autumn range", "n": 4 } }' # 2. Read spend per customer for the month curl "https://api.tovano.ai/v1/usage?group_by=customer&from=2026-11-01&to=2026-11-30" \ -H "Authorization: Bearer $TOVANO_API_KEY"
import Tovano, { formatUsd } from "tovano";
const tovano = new Tovano();
const MARKUP = 1.3; // your margin
const usage = await tovano.usage({ group_by: "customer", from: "2026-11-01", to: "2026-11-30" });
for (const row of usage.data) {
const billed = Math.round(row.charged_micro * MARKUP);
console.log(row.key, row.tasks, formatUsd(row.charged_micro), "->", formatUsd(billed));
}import os, requests
r = requests.get(
"https://api.tovano.ai/v1/usage",
headers={"Authorization": f"Bearer {os.environ['TOVANO_API_KEY']}"},
params={"group_by": "customer", "from": "2026-11-01", "to": "2026-11-30"},
)
MARKUP = 1.3 # your margin
for row in r.json()["data"]:
cost = row["charged_micro"] / 1_000_000
print(f"{row['key']:<14} {row['tasks']:>6} tasks {cost:,.2f} USD -> bill {cost * MARKUP:,.2f} USD")More examples
What else teams run at volume.
Run it on your volume, with your contract.
Committed-volume pricing, monthly invoices, higher limits and a named contact for teams that run AI in production.