Skip to content
providerkit
GitHub

ModelRate

Defined in: core/src/usage.ts:33

USD per million tokens, as every vendor prints its price sheet, so a row can be checked against one without arithmetic.

cacheRead: number;

Defined in: core/src/usage.ts:41

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


optional cacheWrite?: number;

Defined in: core/src/usage.ts:45

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.


optional hosted?: Partial<Record<
| "web_search"
| "web_fetch"
| "code_execution"
| "file_search"
| "image_generation", number>>;

Defined in: core/src/usage.ts:49

USD per hosted tool call (a search, a fetch, a code run), by type, as the vendor’s price sheet states it. Billed beside the tokens; a type left out bills nothing.


input: number;

Defined in: core/src/usage.ts:35

Cache-MISS input: fresh tokens the provider had to read.


output: number;

Defined in: core/src/usage.ts:36