import type { Model } from "../../internal/llm.js"; import { type ModelPricing } from "../pricing.js"; /** How a provider counts cached tokens in its reported `input`. */ export type CacheFamily = "input-includes-cached" | "input-excludes-cached"; /** * Resolve the prompt-cache accounting family for a model. **Auto-inferred from `model.api`** by * default (Anthropic/Bedrock report `input` EXCLUDING cached tokens; OpenAI/vLLM/Google INCLUDE them), * but a deployment can **override** it via `model.params.promptCacheFamily` when `model.api` doesn't * match the brain that actually serves the model — e.g. a routing brain that dispatches by `provider` * while `api` is left at a default. Accepts the explicit values or the aliases `"anthropic"`/`"openai"`. * (design/18: a route-by-provider setup with `api` hardcoded misjudged the family → 1090% hit rate.) */ export declare function cacheFamilyOf(model: Model): CacheFamily; /** Total prompt tokens presented this turn, normalized so `cachedTokens` is always ⊆ `promptTokens`. */ export declare function promptTokensOf(family: CacheFamily, u: { input: number; cacheRead: number; cacheWrite: number; }): number; /** * Normalize one turn's reported usage into its `{ totalInputTokens, costMicroUsd }` — the authoritative * cost re-priced in core from injected pricing (so cached tokens aren't charged at full price). Shared * by the run loop's per-turn accounting and post-task memory consolidation (design/41) so a pricing * change lives in ONE place. We emit only 5-min-TTL cache writes, so `cacheWriteTokensLong` is 0. */ export declare function usageCostMicroUsd(family: CacheFamily, u: { input?: number; output?: number; cacheRead?: number; cacheWrite?: number; }, pricing: ModelPricing): { totalInputTokens: number; costMicroUsd: number; }; //# sourceMappingURL=usage-accounting.d.ts.map