Cost and telemetry
telemetry/cost.py · telemetry/trace.py
usage is a measurement · cost is a claim
Usage
input_tokens
{{ u.input }}
output_tokens
{{ u.output }}
cached_input_tokens
{{ u.cached }}
reported by the provider · always true
× prices.json
input_per_mtok
"0.15"
output_per_mtok
"0.60"
cached_input_per_mtok
"0.075"
parsed from strings · never touches a float
= {{ costTitle }}
{{ costValue }}
{{ costNote }}
Trace · in-process spans
{{ s.name }}
{{ s.ms }}
no OpenTelemetry, no collector, no exporter — spans are objects in a list you can assert on. Names are OTel-shaped, so exporting later is a translation rather than a rewrite.
RunResult
{{ f.name }}
{{ f.q }}
{{ line }}
{{ caption }}