/** * Model Pricing * * Pricing data for supported models and cost calculation utilities. * Prices are in USD per 1 million tokens. * * @module cost/pricing */ import type { ModelId, ModelProvider, ModelPricing, TokenUsage, CallCost } from "./types.js"; /** * Model pricing data (USD per 1M tokens) * Updated as of 2024 */ export declare const MODEL_PRICING: Record; /** * Get model provider from model ID */ export declare function getModelProvider(model: ModelId): ModelProvider; /** * Get pricing for a model */ export declare function getModelPricing(model: ModelId): ModelPricing; /** * Calculate cost for token usage */ export declare function calculateCost(model: ModelId, usage: TokenUsage): CallCost; /** * Estimate cost for a given number of tokens * If outputTokens is not provided, assumes 80% input, 20% output ratio */ export declare function estimateCost(model: ModelId, inputTokens: number, outputTokens?: number): number; /** * Format cost as USD string */ export declare function formatCost(cost: number): string; /** * Format tokens with K/M suffix */ export declare function formatTokens(tokens: number): string; /** * Estimate tokens for text content * Uses rough approximation of ~4 characters per token */ export declare function estimateTokens(text: string): number; /** * Get all supported models */ export declare function getSupportedModels(): ModelId[]; /** * Get models by provider */ export declare function getModelsByProvider(provider: ModelProvider): ModelId[]; /** * Get cheapest model for a provider */ export declare function getCheapestModel(provider?: ModelProvider): ModelId; //# sourceMappingURL=pricing.d.ts.map