Authoritative cost parity
Treat cost_records as the billing ledger, keep unknown spend unknown, and use the same eight-decimal USD contract on every surface.
EvalGate uses one authoritative cost contract for model calls and evaluation runs. Dashboard totals, Model Gateway call detail, workflow and Arena views, evaluation exports, signed reports, CLI output, and SDK payloads all derive known money from cost_records. A model-call ledger row can explain what happened, but it cannot invent or replace a monetary amount.
Status: Beta · Owner: Gateway & Providers / Evidence & Reporting · Last verified: 3.7.0-rc (2026-07-13)
The contract
All serialized monetary values use USD with exactly eight decimal places. Numeric view models may parse those strings for charting, but they must use the same rounding contract when displayed or serialized again.totalUsd is always verifiedUsd + estimatedUsd. It never includes a guessed amount for an unknown call. recordCount counts unique cost records after duplicate protection; confidence counts describe those unique records plus calls that have no cost record where applicable.
Confidence classes
Provider- or gateway-reported totals are stored without recomputing them from local catalog pricing. When a reported total and component prices differ, the reported total remains authoritative and the input/output components are scaled proportionally for a consistent breakdown.
Attribution rules
Retries
Retries
Each provider attempt with its own cost record is charged once. Retry dollars are the sum of explicit retry records only. If the gateway reports a retry count but no per-attempt billing record exists, EvalGate reports the retry count without guessing retry dollars.
Fallbacks
Fallbacks
A fallback call is identified from its terminal state or fallback chain. Its amount comes from the linked cost record. A fallback without a cost record increments the unknown count and contributes no dollars.
Cached input
Cached input
Cached calls keep the amount actually charged by the provider.
cachedInputTokens records the cache attribution and potential savings; it is not subtracted from spend a second time.Cancellation and streaming
Cancellation and streaming
A cancelled or streamed call may still be billable. EvalGate includes money only when the call has a known cost record, while preserving separate cancelled and streamed counts. Partial streaming is not automatically free.
Blocked calls
Blocked calls
A policy or budget block before provider egress is known zero and produces no cost record. It is not counted as unknown. A call that may have reached a provider but lacks billing evidence remains unknown.
Duplicate delivery
Duplicate delivery
Cost records are deduplicated by durable record identity and Model Gateway call ID. The database permits at most one linked cost record per non-null model-call ID. Historical duplicates are retained for auditability but unlinked and marked unknown so they cannot inflate known spend.
Surface consistency
The same ledger and rounding rules apply to every supported surface:Catalog prices are useful for planning and preflight estimates. They do not replace a post-call cost record in reports, gates, or dashboards.
API and SDK usage
Consumers should preserve the decimal strings when storing or signing results. Parse them only when numeric calculation is required, then round back to eight decimal places.Operational checklist
1
Confirm the call identity
Open Model Gateway call detail and confirm the organization, model-call ID, terminal status, and linked cost-record ID.
2
Inspect confidence before comparing totals
Compare
verifiedCount, estimatedCount, and unknownCount. Two surfaces can show the same known dollars while one has more incomplete billing evidence.3
Check attribution
Review retry, fallback, cache, cancellation, streaming, and duplicate counts. A higher total can be legitimate when retries have explicit provider-attempt records.
4
Compare exact serialized values
Use the eight-decimal strings in API, export, report, CLI JSON, and SDK payloads. Avoid comparing a two-decimal screenshot with an eight-decimal export.
5
Reconcile missing records
If a provider call completed but no cost record is linked, keep it unknown and use provenance reconciliation. Do not patch the report with a hand-calculated estimate.
Limits and failure behavior
- Provider billing can arrive late. Until the authoritative record exists, the call remains unknown.
- Unknown-source historical rows remain auditable but do not contribute dollars.
- A retry count alone does not prove retry spend; explicit attempt records are required for dollars.
- Workflow and Arena history created before durable model-call linkage can have unknown counts even when old JSON contains an estimated
costfield. - Signed reports are immutable snapshots. Reconciled cost evidence requires a newly generated report rather than mutation of an existing signature.
- Organization scoping applies to every cost lookup. A cost record from another organization is never used to fill a missing amount.