import { a as TokenUsageNormalized, i as PricingResolver, n as Pricing, r as PricingMap, t as CostBreakdown } from "./types-DY9LSF2_.js"; //#region src/pricing.d.ts /** * Convenience helper for pricing tables that publish USD per 1M tokens. * * Example: input $1.75 / 1M, output $14.00 / 1M. */ declare function pricingFromUsdPerMillion({ inputUsdPerMillion, outputUsdPerMillion, cachedInputUsdPerMillion, cacheCreationInputUsdPerMillion }: { inputUsdPerMillion: number; outputUsdPerMillion: number; cachedInputUsdPerMillion?: number; cacheCreationInputUsdPerMillion?: number; }): Pricing; /** * Creates a `Pricing` instance from USD-per-token values. * * Use this when you already have per-token pricing (rather than per-million). */ declare function pricingFromUsdPerToken({ inputUsdPerToken, outputUsdPerToken, cachedInputUsdPerToken, cacheCreationInputUsdPerToken }: { inputUsdPerToken: number; outputUsdPerToken: number; cachedInputUsdPerToken?: number; cacheCreationInputUsdPerToken?: number; }): Pricing; /** * Resolves pricing from a map, trying common key variants. * * Example: if you pass `openai/gpt-5.2`, it will also try `gpt-5.2`. */ declare function resolvePricingFromMap(map: PricingMap, modelId: string): Pricing | null; //#endregion //#region src/tally.d.ts /** * Estimates USD cost for a single call from normalized usage + pricing. * * Returns `null` if either `usage` or `pricing` is missing. */ declare function estimateUsdCost({ usage, pricing }: { usage: TokenUsageNormalized | null; pricing: Pricing | null; }): CostBreakdown | null; /** One model call to be tallied. */ type TallyCall = { model: string; usage: TokenUsageNormalized | null; }; /** * Aggregated tally output. * * - `total`: sum of all calls where pricing was resolvable * - `byModel`: counts + accumulated usage + (optional) cost per model */ type TallyResult = { total: CostBreakdown | null; byModel: Record; }; /** * Tallies costs across a list of calls, grouped by `model`. * * `resolvePricing(modelId)` can be async (e.g. catalog fetch). */ declare function tallyCosts({ calls, resolvePricing }: { calls: TallyCall[]; resolvePricing: PricingResolver; }): Promise; //#endregion //#region src/usage.d.ts /** * Best-effort normalization of token usage across common provider payloads. * * Accepts `raw` objects containing any of these fields (examples): * - `prompt_tokens`, `completion_tokens` * - `input_tokens`, `output_tokens` * - `inputTokens`, `outputTokens`, `reasoningTokens` * - nested details such as `completion_tokens_details.reasoning_tokens` * and `prompt_tokens_details.cached_tokens` * * Returns `null` if no recognized token fields are found. */ declare function normalizeTokenUsage(raw: unknown): TokenUsageNormalized | null; //#endregion export { CostBreakdown, Pricing, PricingMap, PricingResolver, TallyCall, TallyResult, TokenUsageNormalized, estimateUsdCost, normalizeTokenUsage, pricingFromUsdPerMillion, pricingFromUsdPerToken, resolvePricingFromMap, tallyCosts };