/** * OpenRouter model catalog fetcher. * * GET https://openrouter.ai/api/v1/models returns the full catalog * (300+ entries) with per-token pricing in USD. We cache the result * for the duration of the process — the catalog only changes when * OpenRouter adds/removes models, which is rare enough that one * fetch per REPL session is the right trade-off. * * Pricing in the response is per-token; we convert to per-1M tokens * for display because that's how everyone quotes LLM costs. * * No auth required for /models (it's public). We hit it without the * user's API key so it works even before the user has finished * configuring their key. */ export interface OpenRouterModel { /** Canonical model ID, e.g. "anthropic/claude-sonnet-4". */ id: string; /** Display name, e.g. "Claude Sonnet 4". */ name: string; /** Context window in tokens, or null if unknown. */ contextLength: number | null; /** USD per million input tokens. */ promptPerM: number; /** USD per million output tokens. */ completionPerM: number; /** True when the model is free (both prompt + completion = 0). */ isFree: boolean; } /** * Fetch the OpenRouter model catalog, normalized + sorted (free * models first, then alphabetical by ID). * * Returns an empty array on any network / parse failure instead of * throwing — the caller is typically the model-picker, which can * gracefully say "couldn't fetch models" without aborting the REPL. */ export declare function fetchOpenRouterModels(): Promise; /** * Format the per-million pricing as a compact column for use in * the picker's hint field. "in:$0.14 out:$0.28 · 128k" style. */ export declare function formatPricing(m: OpenRouterModel): string;