Costs & Pricing

Platform

How 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.

SDK estimate

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 · Recomputed

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?

The SDK cost tells you what your agent "thought" it cost at run time — useful for auditing SDK behavior, debugging pricing discrepancies, or reviewing what pricing snapshot was active at a specific point in time. The platform cost is the single source of truth for billing attribution and cross-agent reporting, since it applies consistent org-level rates retroactively.

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.

Dashboard homepage
PrimaryTotal token spend card — platform cost sum across all agents
SDK fallbackn/a (aggregate only)
Agents list
Primary"Cost" column — platform cost total per agent
SDK fallbackTooltip clarifies source
Agent detail page
Primary"Total Cost" summary — platform cost sum for the agent
SDK fallbackTooltip clarifies source
Traces list
Primary"Cost ($)" column — platform cost total per trace
SDK fallbackTooltip clarifies source
Trace detail — header
PrimaryPlatform cost total with coverage indicator (e.g. "2 / 3 spans")
SDK fallback"SDK reported: $X.XXXX" footnote beneath
Span detail panel
PrimaryLarge green cost card with "Platform · Recomputed" badge and pricing version tooltip
SDK fallbackCollapsible "SDK-side pricing context" section with llm.pricing.* attributes

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:

1. Platform fetches the latest pricing from upstream
2. New snapshot is versioned and stored (pricing_versions)
3. pricing_current is updated atomically
4. Any spans ingested after this point use the new snapshot
5. A targeted backfill runs for spans whose model prices changed

In 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

Run 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. 1

    Go to Settings → Pricing in the Traccia dashboard.

  2. 2

    Find the model you want to override, or add a new entry for a custom model name.

  3. 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. 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:

json
{
"<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

Overrides affect the platform's recomputed cost. They do not change the original 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_usd and spans.cost_usd are 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.usd SDK 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

Each agent process may run with a different SDK version or cached pricing file. The platform uses one consistent, centrally-managed snapshot for all cross-agent reporting, ensuring numbers are comparable regardless of which SDK version your agents run.

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.