Costs & Pricing
PlatformHow Traccia tracks, recomputes, and attributes LLM costs across your agents — and how to configure pricing for your organization.
Every LLM call traced by Traccia carries cost information. The platform maintains a two-layer cost model: an SDK-reported estimate emitted at run time, and a platform-recomputed authoritative cost calculated server-side using the platform's own up-to-date pricing snapshot and any org-level overrides you have configured. Platform costs are what you see throughout the Traccia dashboard.
The Two-Layer Cost Model
Each LLM span carries two separate cost values. They are always kept distinct — the SDK value is never overwritten.
llm.cost.usd
Computed by the SDK in your application process at the moment the span ends, using whichever pricing snapshot was active at that time (bundled, cached, or overridden). Written once to the span and never changed by the platform.
platform_cost_usd
Computed by the platform asynchronously after ingestion, using the platform's authoritative pricing snapshot and any org-level overrides you have configured. This is the primary cost shown in all dashboards, trace lists, and agent pages.
Why keep both?
Where Costs Appear
Platform-recomputed costs are the primary figure shown everywhere in the dashboard. SDK-estimated costs are available as a secondary detail for comparison and debugging.
When a span does not yet have a platform-recomputed cost (for example, immediately after ingestion before the background annotation job has run), the SDK estimate is shown as the fallback.
Platform Pricing Sync
The platform maintains its own pricing snapshot, sourced from a continuously maintained upstream database of 2,500+ models. It is refreshed automatically every 6 hours. The sync sequence is:
pricing_versions)pricing_current is updated atomicallyIn addition to the sync-triggered backfill, a live annotation job runs every 15 seconds and annotates any recently-ingested spans that do not yet have a platform cost. This means new traces are typically annotated within 15 seconds of ingestion.
Keeping your SDK in sync
traccia pricing refresh in your project to pull the platform's current snapshot into your SDK's local cache. This minimises divergence between llm.cost.usd (what the SDK emits) and platform_cost_usd (what the platform computes). See the SDK Pricing & Costs page for details.Org-Level Pricing Overrides
Org admins can define custom per-model prices that override the platform's global snapshot for all agents in the organisation. Common use cases include fine-tuned models with custom API pricing, negotiated enterprise rates, or internal cost allocation that differs from list prices.
Setting an override
- 1
Go to Settings → Pricing in the Traccia dashboard.
- 2
Find the model you want to override, or add a new entry for a custom model name.
- 3
Enter prompt and completion rates in USD per 1,000 tokens. Optionally set cache_write and cached_prompt rates for models that support prompt caching.
- 4
Save. You will be offered the option to "Also recompute past traces" — enable this to retroactively apply the new rates to existing spans.
Override JSON schema
Whether set via the UI or programmatically, all pricing overrides use the same JSON shape:
{ "<model-name>": { "prompt": 0.005, "completion": 0.015, "cache_write": 0.001, "cached_prompt": 0.0005 }}All rates are USD per 1,000 tokens. cache_write and cached_prompt are optional.
Org overrides apply to platform_cost_usd only
llm.cost.usd attribute on existing spans — that value is preserved exactly as the SDK emitted it.Recomputing Past Traces
When you save a pricing override, the save dialog offers a "Also recompute past traces" option. When enabled:
- All LLM spans for models covered by the override are re-evaluated against the new rates.
platform_cost_usdandspans.cost_usdare updated in bulk.- Trace-level totals (
traces.total_cost) are recalculated to reflect the updated span costs. - Each updated span records which pricing version was used for the recomputation, visible in the span detail panel.
- The original
llm.cost.usdSDK value is never overwritten.
Recomputation scope defaults to the past 24 hours. For longer lookback windows, contact support.
When SDK and Platform Costs Diverge
You may occasionally see a muted "SDK reported $X.XXXX" note alongside the platform cost in the span detail panel. This is expected and happens for one of three reasons:
Stale SDK snapshot
The SDK's bundled or cached pricing was slightly older than the platform's current snapshot at the time the span was emitted. The difference is usually pennies per call.
Resolution: Run `traccia pricing refresh` to pull the latest snapshot into the SDK's local cache.
SDK-level override
The agent process was started with a pricing_override or TRACCIA_PRICING_OVERRIDE_JSON set. SDK-level overrides apply to llm.cost.usd only; the platform uses its own snapshot and org overrides independently.
Resolution: Intentional — both values are correct in their respective contexts.
Org-level override on the platform
An org admin has set a custom price for this model in Settings → Pricing. The platform applies this rate to platform_cost_usd; the SDK does not know about org overrides.
Resolution: Intentional — org overrides are a platform-side feature by design.
The platform never uses the SDK's local cache
Cost Attribution Dimensions
The platform attributes costs along several dimensions for filtering and analysis:
By Agent
Total and per-trace cost for each registered agent. Visible on the Agents list and agent detail page.
By Model
Cost breakdown across GPT-4o, Claude 3.5, Gemini Flash, etc. Visible in the Top Models panel on the dashboard.
By Trace
Cost for a single end-to-end agent run, including all LLM spans. Visible in the Traces list and trace detail header.
By Span
Cost for a single LLM call, with full pricing context. Visible in the span detail panel.
By Environment
Separate tracking for production, staging, dev, etc. Filter using the Environment selector on any list page.
By Team / Workspace
Workspaces scope traces and costs to a team or project. Visible when workspace filtering is active.
Next Steps
© 2026 Traccia.