/** * Pricing table types for hazo_llm_api. * * Each entry is keyed by "/" (e.g. "openai/gpt-4o-2024-08-06"). * Token-based services use *_per_1m_usd rates; image gen uses per_image_usd. */ export type PricingKind = "text" | "image" | "embedding" | "audio"; export interface PricingEntryText { kind: "text"; input_per_1m_usd: number; output_per_1m_usd: number; /** Anthropic prompt-cache hits / OpenAI cached input tokens — discounted rate. */ cached_input_per_1m_usd?: number; } export interface PricingEntryImage { kind: "image"; per_image_usd: number; } export interface PricingEntryEmbedding { kind: "embedding"; input_per_1m_usd: number; } export interface PricingEntryAudio { kind: "audio"; input_per_min_usd?: number; output_per_min_usd?: number; } export type PricingEntry = PricingEntryText | PricingEntryImage | PricingEntryEmbedding | PricingEntryAudio; export type PricingTable = Record; export type FinishReason = "stop" | "length" | "content_filter" | "tool_calls" | "error"; export interface UsageTokens { input: number; output: number; total: number; /** Provider-reported cached input tokens (Anthropic cache hits, OpenAI cached tokens). */ cached_input?: number; } export interface UsageAttempt { provider: string; success: boolean; error_code?: string; latency_ms: number; } export interface UsageInfo { /** The actual model used (as reported by the provider). */ model: string; provider: string; tokens: UsageTokens; /** null when pricing for this model is unknown. */ cost_usd?: number; /** Exact pricing-table entry applied — frozen audit trail. */ pricing_applied?: PricingEntry; latency_ms: number; finish_reason?: FinishReason; /** Populated only when a cascade actually fired (more than one attempt). */ attempts?: UsageAttempt[]; } //# sourceMappingURL=types.d.ts.map