import type { PricingMode, PricingOverride, PricingTable } from './types.js'; import { BUILTIN_PRICING_VERSION } from './tables/index.js'; export type { PricingTable, ModelPrice, CacheMultipliers, LongContextPrice, PricingOverride, PricingMode, } from './types.js'; export { anthropicPricing, openaiPricing, providerTables, builtinPricing } from './tables/index.js'; export { COMMUNITY_PRICING_URL, communityPricingDisabledBy, communityPricingUrl, convertLiteLLMPrices, readCommunityPricing, withCommunityPricing, writeCommunityPricing, type CommunityPricing, type ConvertedList, } from './community.js'; /** * Where a user can drop prices without waiting for a release. * * Two distinct jobs, and the second is the common one: correcting a built-in * price that has gone stale, and adding a provider the package does not ship at * all. Both are served by overlaying rather than replacing -- see * {@link loadPricing}. `ai-usage status` reports which file is in force. */ export declare function pricingOverridePath(): string; export declare function configDir(): string; /** Where the downloaded community price list is cached. See `./community.ts`. */ export declare function communityPricingPath(): string; /** What the community price list contributed to the table in force, for `status`. */ export interface CommunityPricingState { /** The list's URL. */ source: string; /** Why community prices are not in effect, when they are not. */ disabledBy?: string; /** When the cached list was downloaded. Absent until the first refresh succeeds. */ fetchedAt?: string; /** The models it priced: only those the built-in tables lack. */ added: string[]; } export interface LoadedPricing { table: PricingTable; /** Set when a user override file contributed to the table in force. */ overridePath?: string; /** How the table was assembled. `builtin` when no override file exists. */ mode: PricingMode; /** The built-in version an overlay sits on top of. Absent for other modes. */ baseVersion?: string; /** Absent only when a caller handed a table over directly. */ community?: CommunityPricingState; } /** Parses and validates an override file. Never guesses at a missing field. */ export declare function parsePricingOverride(path: string, raw: unknown): PricingOverride; /** Applies an override onto the built-in table, or replaces it outright. */ export declare function applyPricingOverride(base: PricingTable, override: PricingOverride, path: string): LoadedPricing; /** * Loads the built-in table, plus a user override if one is present and valid. * * The override is an **overlay** by default: its models are merged over the * built-in ones by model id. It used to replace the table wholesale, which meant * adding a single missing provider cost you every Anthropic price you had -- so * the mechanism that existed for adding a model made the tool report less. * `"replace": true` still does the old thing for anyone who wants it. * * A malformed override throws rather than silently falling back: quietly using * different prices than the user thinks are in effect would be worse. * * Underneath the override sit the community prices (see `./community.ts`), * filling only the models the built-in tables lack. An override still wins over * them, and a `"replace": true` override discards them along with the built-in * table, since starting from nothing is what it asks for. */ export declare function loadPricing(): LoadedPricing; export { BUILTIN_PRICING_VERSION };