Skip to content

Cost Summary

Every session in Ptah has a live cost summary — tokens consumed, dollars spent, messages exchanged, and wall-clock duration. It’s visible per session in the header, and aggregated across sessions in Analytics.

Cost summary card

MetricDescription
Input tokensTokens sent to the model (prompts, tool results, history)
Output tokensTokens returned by the model
Cache read tokensTokens served from prompt cache (billed at a discount)
Cache write tokensTokens written to prompt cache
Total cost (USD)Provider-priced sum of all token classes
Message countUser + assistant + tool turns
DurationFirst-message to last-message wall-clock time
Active durationTime actually spent generating, excluding idle

A compact cost badge sits next to the session title. Hover for the full breakdown.

Each session row in analytics shows totals. Click the row to see per-turn breakdown.

The global status bar shows today’s running cost across all sessions. Click it to open the analytics dashboard scoped to today.

Expand any message to see the exact cost of that turn:

Turn 14 — backend-developer
Input: 12,480 tokens ($0.1872)
Cached: 8,100 tokens ($0.0243)
Output: 1,240 tokens ($0.1860)
Total: $0.3975

This is especially useful for spotting expensive single turns (big tool outputs, long pasted files) so you can adjust context.

Costs come from the provider’s reported usage. When a provider doesn’t return a per-call price, Ptah applies the public list price for that model at the time of the call. You can override pricing per model in:

{
"ptah.pricing.overrides": {
"claude-opus-4-7": {
"inputPer1M": 15.0,
"outputPer1M": 75.0,
"cacheReadPer1M": 1.5,
"cacheWritePer1M": 18.75
}
}
}

Overrides are applied going forward; historical records keep the price they were recorded with.

Set a daily cost budget in Settings → Sessions → Budget:

{
"ptah.budget.dailyUsd": 25,
"ptah.budget.warnAtPercent": 80,
"ptah.budget.blockOverBudget": false
}
  • Warn — banner in the status bar at 80% of budget
  • Block — when enabled, new turns are paused at 100% until you raise the budget or wait for the next day

The cost column is included in Session history exports (CSV and JSON). You can pipe CSV into your spreadsheet of choice for finance reporting.

Cost data is local to your machine. Ptah does not report usage or spend to any external service.