Report Usage, Not Cost
Why AI agent instrumentation should emit raw usage metrics while the backend calculates dollars.
Report usage, not cost means application code records facts such as tokens, characters, requests, or seconds. The backend calculates dollars from pricing tables. This keeps pricing editable, customer-specific, auditable, and independent from code deploys.
- - Should the SDK send cost_usd?
- - How should AI usage metering handle pricing changes?
- - How do I support per-customer pricing without changing code?
The Rule
Hot-path application code should describe what happened. It should not decide the commercial value of what happened.
For LLM calls, the SDK reports model and token usage. For non-LLM work, code reports a metric and value. AgentMeter applies pricing centrally.
Why It Matters
Vendor prices change. Customer contracts differ. Billing rules evolve. Moving cost math out of runtime code lets founders adjust pricing without asking engineering to redeploy every integration.
| Runtime reports | Dashboard owns | Outcome |
|---|---|---|
| tokens_in and tokens_out | model price table | LLM spend |
| characters | speech price per unit | TTS or STT spend |
| requests | search API price | retrieval spend |
| executions | workflow price | automation spend |
A Small Example
The agent reports 4,200 characters for a speech step. AgentMeter applies the builder's current ElevenLabs-style character price and attributes the result to the customer.
import { reportUsage } from "@agentmeter/sdk";
reportUsage({
customer_id: "acme-corp",
tool: "tts",
metric: "characters",
value: 4200,
step: "speak_answer",
});Why not send cost_usd directly?
That makes runtime code responsible for pricing and creates drift when vendor rates or customer contracts change.
Does this work for LLM and non-LLM sources?
Yes. LLM usage maps to model pricing; non-LLM usage maps to builder-configured metric pricing.
Can historical prices change?
AgentMeter treats pricing changes as versioned forward changes, not silent rewrites of old usage.
Non-LLM Cost Tracking For AI Agents
How to track search, speech, vector database, workflow, and other non-LLM API costs next to model spend.
Usage-Based Billing For AI Agents
How AI agent businesses can turn cost telemetry into customer-facing usage, invoices, and pricing controls.
AgentMeter Vs Paid.ai
A factual comparison for AI companies choosing between usage billing workflows and SDK-first cost infrastructure.