ModelRate
Defined in: core/src/usage.ts:20
USD per million tokens, as every vendor prints its price sheet, so a row can be checked against one without arithmetic.
Properties
Section titled “Properties”cacheRead
Section titled “cacheRead”cacheRead: number;Defined in: core/src/usage.ts:28
Cache-HIT input. Providers auto-cache repeated prefixes and bill the hit portion far cheaper: 0.1× on Anthropic, ~0.1× on Gemini, 0.5× on some OpenAI models. In an agent loop the re-sent context is overwhelmingly hits, so billing it at the miss rate overcounts by up to 10×.
cacheWrite?
Section titled “cacheWrite?”optional cacheWrite?: number;Defined in: core/src/usage.ts:32
Input WRITTEN to cache. Anthropic bills this ABOVE the input rate
(1.25×); the OpenAI-shape auto-cachers bill it at the input rate.
Defaults to input when a vendor does not price it separately.
input: number;Defined in: core/src/usage.ts:22
Cache-MISS input: fresh tokens the provider had to read.
output
Section titled “output”output: number;Defined in: core/src/usage.ts:23