/** * Versioned provider/model token prices. * * Prices are intentionally request-time contracts, not one global multiplier: * uncached input, cache reads, cache writes, and output are distinct billable * dimensions. A catalog match is exact (or an explicitly documented alias), * and every result carries the source and effective date used to compute it. */ export type PriceCurrency = 'USD' | 'CNY'; export interface TokenUsageDimensions { uncachedInputTokens: number; cachedInputTokens: number; cacheWrite5mInputTokens: number; cacheWrite1hInputTokens: number; cacheWriteInputTokens: number; outputTokens: number; } export interface TokenPriceTier { maxInputTokens?: number; uncachedInput: number; cachedInput: number; cacheWrite5m: number | null; cacheWrite1h: number | null; cacheWrite: number | null; output: number; } /** * A price list with no tier prices nothing, so the type makes that * unrepresentable: every contract carries at least one tier, and the tier * lookup therefore never has to invent one for an empty list. */ export type NonEmptyTiers = readonly [TokenPriceTier, ...TokenPriceTier[]]; export interface ModelPriceContract { provider: string; route: string; model: string; aliases: readonly string[]; currency: PriceCurrency; verifiedAt: string; effectiveFrom?: string; effectiveTo?: string; sourceUrl: string; sourceLabel: string; tiers: NonEmptyTiers; } export interface PricedTokenUsage { available: boolean; provider: string; route: string; requestedModel: string | null; resolvedModel: string | null; currency: PriceCurrency | null; amount: number | null; ratesPerMillion: TokenPriceTier | null; usage: TokenUsageDimensions; breakdown: { uncachedInput: number; cachedInput: number; cacheWrite5m: number; cacheWrite1h: number; cacheWrite: number; output: number; } | null; sourceUrl: string | null; sourceLabel: string; effectiveFrom: string | null; effectiveTo: string | null; verifiedAt: string | null; reason: string | null; } /** * Prices read off each vendor's own page, model by model, on VERIFIED_AT. * * NO FALLBACK ROW. A model absent from this list is reported as unpriced, never * charged at some default rate: an absent number can be chased, a fabricated * one is indistinguishable from a measured one in the same column. * * NO ASSUMED FUTURE EITHER. An effective window is only written when the vendor * has published the change. Two rows here previously encoded a scheduled * increase that was then cancelled, which silently billed every request on * those models 50% high -- the reverse of the error everyone expects. */ export declare const MODEL_PRICE_CATALOG: readonly ModelPriceContract[]; export declare function normalizeUsageDimensions(usage?: Partial): TokenUsageDimensions; export declare function inferProviderRoute(client: string | null | undefined, model: string | null | undefined, provider?: string | null): { provider: string; route: string; }; export declare function priceTokenUsage(input: { client?: string | null; provider?: string | null; route?: string | null; model?: string | null; timestamp?: string; usage?: Partial; }): PricedTokenUsage; //# sourceMappingURL=provider-pricing.d.ts.map