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;
/**
 * 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;
//#endregion
export { calculateCost, enableLivePriceUpdates, getGenaiPriceLookupCandidates, inferProvider, stripProviderPrefix };
//# sourceMappingURL=costs.d.ts.map