Pricing & USD-denominated budgets¶
A Agentic SpendGuard tenant can spend a single USD budget across multiple LLM providers (OpenAI, Anthropic, Bedrock, Azure OpenAI, Gemini). The flow:
- Pricing table —
pricing_tablein canonical DB stores(provider, model, token_kind) → $/1M tokens. Loaded fromdeploy/demo/init/pricing/seed.yamlat compose-up time. - Pricing freeze — bundle build picks the latest
pricing_versionand embeds the snapshot hash incontract_bundle.metadata.json. Sidecar reads it at startup; production deploys validate via cosign. - Adapter conversion — adapter computes µUSD per call:
(input_tokens × $/1M_input + output_tokens × $/1M_output) × 10^6. - Sidecar reserve — adapter submits
BudgetClaim(amount_atomic=N µUSD). Sidecar reserves under theusd_microsunit (scale=6). - Sidecar commit — adapter sees the actual provider response, recomputes µUSD, sidecar commits via CommitEstimated.
The multi_provider_usd demo mode shows this end-to-end with real
OpenAI + Anthropic in the same session against a shared USD budget.
See pricing.py for the helper that does the conversion.