Zorveus LogoZorveusDOCS
Core Concepts

Usage and cost accounting

View Markdown

Understand how Zorveus calculates virtual spend, wallet charges, provider costs, and cache-aware token usage.

Every inference request produces an immutable usage event recorded in your organization account.


The three financial amounts

Inference requests generate three separate financial values. Each answers a different accounting question:

AmountDescriptionApplies to wallet modeApplies to BYOK mode
virtual_spendReference-priced value of AI usage consumed against caps and creditsYesYes
sell_costAmount debited from your Zorveus organization walletYesNo ($0.00 provider charge, explicit platform fee may apply)
provider_costUpstream cost charged by the model providerYes (recorded for margin reporting)Yes (recorded for fee calculation and cost reporting)

Virtual spend uses identical reference pricing regardless of whether the call was funded by wallet or BYOK. Changing the funding source does not change how much product allowance the request consumes.


Cache-aware token tracking

Zorveus tracks input tokens across cache categories:

  • Total input tokens (input_tokens): The normalized grand total of all input tokens, including normal input and cache categories.
  • Cache read tokens (cache_read_input_tokens): Tokens read from an active provider cache. These cost less than normal input tokens.
  • Cache creation tokens (cache_creation_input_tokens): Tokens written to cache with the default duration.
  • One-hour cache creation tokens (cache_creation_1h_input_tokens): Tokens written with a one-hour retention window.
  • Normal input tokens: Uncached prompt tokens, calculated as total input minus cache reads and cache creations.

Settlement calculates cache_savings by comparing the cache-read cost against standard input rates. In BYOK mode, this value represents AI allowance saved on reference pricing, not provider bill discounts.


Usage event dimensions

Each usage event captures full contextual and financial metadata:

DimensionTypeDescription
usage_event_idstringUnique identifier (ue_...) for the usage event.
timestampstringISO 8601 timestamp of request completion.
app_idstringApplication identifier associated with the request.
modelstringModel name resolved for inference.
providerstringUpstream provider executing the request (openai, anthropic, etc.).
billing_modestringwallet or byok_external.
statusstringsucceeded, partially_settled, or failed.
input_tokensintegerTotal normalized input tokens.
output_tokensintegerOutput completion tokens.
cache_read_input_tokensintegerInput tokens retrieved from provider prompt cache.
cache_creation_input_tokensintegerInput tokens written with default cache duration.
cache_creation_1h_input_tokensintegerInput tokens written with one-hour cache duration.
virtual_spenddecimal stringReference-priced allowance consumed.
sell_costdecimal stringActual charge debited from the organization wallet.
provider_costdecimal stringUpstream provider cost.
uncovered_virtual_spenddecimal stringVirtual spend exceeding allowance in track-only mode or overruns.
unfunded_wallet_chargedecimal stringWallet charge that could not be debited due to wallet exhaustion.
cache_savingsdecimal stringReference-priced allowance saved by prompt caching.
overrun_policystringActive overrun policy: limit_output, allow_overrun, or carry_overrun_forward.
product_end_user_idstringInternal Zorveus identifier for the attributed product user.
external_user_idstringCustomer lookup ID from your application.

All financial amounts are represented as decimal strings with high fractional precision. SDKs and custom integrations should parse them with a decimal library rather than binary floating point.

Was this page helpful?
Edit this page on GitHub

On this page