Observe one run and estimate its cost
Host function: pass a configured model, its current per-1,000-token prices, and the input. Install matching@agentium/core and @agentium/observability, plus the selected provider dependency. The function owns the Agent and observer; a live provider makes a real request.
model.modelId, so changing models does not accidentally retain the previous model’s lookup key. The caller must update the values too. The v4 bundled price table predates the current text models in these docs.
Supply matching prices
ModelPricing uses dollars per 1,000 tokens. Prices listed per million must be divided by 1,000. For example, the standard uncached text rates checked on October 4, 2026 were:
These are dated example rates from the OpenAI model catalog. Recheck your provider, model, service tier, caching, and audio/reasoning billing when adapting them. See example model choices and the pricing type.
Add a budget with the right expectation
Configuration factory: the caller attaches this tracker to the Agent(s) it wants to account for. The model ID and prices must match those executions.Choose an evidence destination
Delivery through a bounded exporter is not an authoritative audit ledger. Flush owned telemetry after active runs and Agent cleanup settle; the host owns shutdown of borrowed exporters or SDK providers according to their contract.