/** * Cost estimator — live pricing from OpenRouter (primary) + LiteLLM (fallback) * with a 24h localStorage cache and a hardcoded offline fallback. * * Data sources: * • https://openrouter.ai/api/v1/models (367+ models, CORS-clean, USD/token) * • https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json * (2700+ entries, CORS-clean, input_cost_per_token/output_cost_per_token) * * Normalization: Bedrock IDs like `global.anthropic.claude-opus-4-7` are * stripped of the region/profile prefix before matching. */ type PriceRow = { input: number; output: number; context?: number; }; /** Boot the price table: cache → immediate; network → 24h refresh. */ declare function initPricing(): void; /** Estimate USD cost for a turn. */ declare function estimateCost(model: string, inputTokens: number, outputTokens: number): number; /** Get the context window size for a model (defaults to 128k). */ declare function getContextWindow(model: string): number; declare function formatCost(usd: number): string; /** Return per-1M-token input/output prices (for display, e.g. Settings tab). */ declare function getPriceRow(model: string): PriceRow; /** Force-refresh the pricing table (skips cache). Useful for "Update" buttons. */ declare function forceRefreshPricing(): Promise; /** Is the pricing table ready to answer lookups? */ declare function isPricingReady(): boolean; /** How many entries are in the live table (useful for diagnostics). */ declare function getPricingEntryCount(): number; export { estimateCost, forceRefreshPricing, formatCost, getContextWindow, getPriceRow, getPricingEntryCount, initPricing, isPricingReady };