AI & API monetization
Requests, tokens, tasks, tool calls and outcomes are product facts. Credits, markup, packages and invoices are pricing decisions. Keep those layers separate so monetization can evolve without re-instrumenting the API.
Count the stable quantity your system can defend: requests, tokens, tasks, tool calls, active users or another numeric unit. That quantity should survive pricing changes.
Pass-through, markup, flat packages, included allowances and prepaid credits are rating decisions. Apply them in your billing or application layer instead of baking them into instrumentation.
Rate limits protect the hot path. Billing meters preserve history. A gateway counter can block traffic without becoming the financial source of truth.
If some buyers arrive through a marketplace and others contract directly, keep one independent usage record behind both channels so totals can be reconciled consistently.
Move from per-request to hybrid pricing, or from credits to committed usage, without editing every call site. The application keeps emitting the same measured fact.
Retained accepted events and rollups let support trace a billed quantity back to the usage that produced it instead of relying on an ephemeral quota counter.
Implementation pattern
The application records the quantity. Your billing system decides whether that quantity becomes a credit drawdown, a marked-up line item, an included allowance or an overage charge.
For richer model/task/evaluation metadata, keep that telemetry in your application analytics or split distinct billable streams into explicit meters/product items. The public usage payload remains intentionally small.
curl -X POST https://api.usagebox.com/api/v1/usage \
-H 'x-api-key: <your_api_key>' \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '[{ "subscription": "<subscription_ingest_key>", "meter": "<meter_ingest_key>", "value": 1 }]'Product boundary
That boundary is what keeps monetization flexible. The measured fact should be stable; customer-facing pricing and financial operations can evolve independently.
Choose the usage signal, inspect the exact payload, then create a free key only when the contract fits your integration.