import { inferProviderFromModel } from "./providers.js"; //#region src/utils/costs.d.ts /** * Opt in to background price updates from the genai-prices GitHub repo. * * Call once at application startup (e.g. after `AmplitudeAI` init) to fetch * the latest pricing data periodically. This ensures new model pricing is * available within days of being added to the genai-prices repository, * instead of waiting for an npm package release. * * This makes outbound HTTPS requests to raw.githubusercontent.com. * Only enable in environments where outbound network access is permitted. * * @param intervalMs - refresh interval in milliseconds (default: 1 hour) */ declare function enableLivePriceUpdates(intervalMs?: number): void; declare function stripProviderPrefix(modelName: string): string; /** * Infer the provider name from a model name. * Delegates to the canonical implementation in utils/providers.ts. */ declare const inferProvider: typeof inferProviderFromModel; /** * Model and default provider to price a Fireworks call with. * * Tier routers (`.../routers/-fast`) bill at their tier, so they keep the * requested router id even though the response reports the base model. Other * routers, FireRouter included, are not separately priced: each request bills at * the model it selected. A selected model outside Fireworks (a BYOK Claude turn) * is priced by model-name inference, or omitted when nothing matches. */ declare function fireworksPricingTarget(requested: string, selected: string | undefined): { modelName: string; defaultProvider: string | undefined; }; /** Pricing inputs for a provider call; Fireworks follows `fireworksPricingTarget`. */ declare function pricingTarget(providerName: string, requested: unknown, selected: string): { modelName: string; defaultProvider: string | undefined; }; declare function fireworksExplicitPriceCost(options: { modelName: string; inputTokens: number; outputTokens: number; cacheReadInputTokens?: number; cacheCreationInputTokens?: number; defaultProvider?: string; }): number | null; /** Backward-compatible name matching the Python public helper. */ declare const fireworksFastTierCost: typeof fireworksExplicitPriceCost; /** * Generate candidate (modelRef, providerId) pairs for price lookup. * * For Bedrock/AWS models, uses a **generalized** dot-prefix stripping strategy * instead of enumerating known regions or vendors. Bedrock model IDs follow * `[region.][vendor.]model-name[-version]` — we progressively strip * dot-separated prefixes and try each variant with and without provider, * plus `regional.` / `global.` prefixes that genai-prices uses. * * This approach is forward-compatible: new AWS regions and Bedrock vendors * work automatically without code changes. */ declare function getGenaiPriceLookupCandidates(modelName: string, defaultProvider?: string): Array<{ model: string; providerId?: string; }>; /** * Calculate cost for an LLM call using genai-prices. * * IMPORTANT CONTRACT: * - `inputTokens` MUST be the TOTAL input token count (including cached tokens). * For Anthropic: raw input_tokens + cache_read + cache_creation. * For OpenAI: prompt_tokens already includes cached_tokens. * - `outputTokens` MUST be the TOTAL output token count (including reasoning tokens). * For OpenAI: completion_tokens already includes reasoning_tokens. * Do NOT pass reasoning tokens separately and then add them here. * - `cacheReadInputTokens` and `cacheCreationInputTokens` are SUBSETS of inputTokens, * used only for differential pricing (cached tokens are cheaper). * - `reasoningTokens` is IGNORED for cost calculation — it exists only for backward * compatibility. Reasoning tokens are already included in outputTokens. */ declare function calculateCost(options: { modelName: string; inputTokens: number; outputTokens: number; /** @deprecated Ignored — reasoning tokens are already included in outputTokens. */ reasoningTokens?: number; cacheReadInputTokens?: number; cacheCreationInputTokens?: number; defaultProvider?: string; }): number | null; //#endregion export { calculateCost, enableLivePriceUpdates, fireworksExplicitPriceCost, fireworksFastTierCost, fireworksPricingTarget, getGenaiPriceLookupCandidates, inferProvider, pricingTarget, stripProviderPrefix }; //# sourceMappingURL=costs.d.ts.map