/** * Token → USD estimation. * * Three things make this genuinely hard, and all three are handled by admitting * uncertainty rather than papering over it: * * 1. Transcripts record token counters, not money. Any USD figure is modelled. * 2. On subscription plans there is no per-run price at all. The honest answer for * those runs is "unknown", not "$0.00". * 3. Prices change. The table lives in data (and can be overridden by a JSON file * at $FLIGHTREC_PRICES) so it can be corrected without touching code. * * Cache accounting matters: cache reads are roughly a tenth of input price while * cache writes are more expensive than input. A long agentic run is mostly cache * reads, so collapsing all input tokens into one rate overstates cost badly. */ import { type Usage } from "../model.js"; export interface Price { input: number; output: number; } /** * The date the built-in table below was last checked against published pricing. * Surfaced in every postmortem: a price table that goes stale silently is worse * than one that admits its age, because the cost thresholds in the risk * detectors are calibrated in dollars. */ export declare const PRICES_UPDATED = "2026-08-16"; /** * USD per million tokens, keyed by model family. Verify against the current * pricing page before trusting absolute numbers; the relative shape * (cache read ≈ 0.1×, cache write ≈ 1.25×) is what the analysis depends on. * * Keys are resolved by `familyOf()` below, not by substring order, so a new * model generation is a one-line addition here rather than a code change. */ export declare const DEFAULT_PRICES: Record; export declare function priceTableSourceName(): string; /** * Map a model id onto a price-table key. Separated from the lookup so the * mapping is testable on its own and so an override file only has to supply * family prices, not enumerate every model id. */ export declare function familyOf(model: string): string | null; export declare function priceFor(model: string): Price | null; /** * Fills usage.costUsd in place. Leaves it null when nothing can be priced. * * Skipped entirely when the source already reported an exact cost — some * agents record what they were actually charged, and a modelled number must * never overwrite a real one. */ export declare function estimate(usage: Usage): Usage; export declare function describeCost(usage: Usage): string;