loadModelPrices
Purpose and behavior
Section titled “Purpose and behavior”Fetch a bounded, cancellable models.dev or OpenRouter catalog once and return a frozen price table for the explicitly selected model aliases. Catalog prices are USD; EUR requires a caller-supplied exchange rate. Normalize OpenRouter per-token rates to per-million rates. Refuse missing models, invalid prices and unsupported tier or extra charges; no refresh or network access occurs during workflow accounting. The table estimates token charges only; taxes, discounts, tools, images and other billing dimensions are excluded.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”optionsRequiredModelPricesOptionsCatalog selection, model aliases, currency conversion and bounded HTTP request settings.options.sourceOptional"models.dev" | "openrouter" | undefinedPublic catalog to load: models.dev (default) or openrouter.options.providerOptionalstring | undefinedRequired models.dev provider ID; ignored for OpenRouter.options.modelsRequiredReadonly<Record<string, string>>Outpost model names mapped to exact IDs in the selected catalog; loads only these prices.options.currencyOptional"EUR" | "USD" | undefinedOutput currency, USD by default; EUR requires usdExchangeRate.options.usdExchangeRateOptionalnumber | undefinedCaller-supplied amount of EUR for one USD when currency is EUR. USD accepts only 1.options.urlOptionalstring | undefinedOptional absolute HTTP(S) catalog endpoint, without embedded credentials or fragment. Defaults to the public source URL.options.signalOptionalAbortSignal | undefinedCancels the catalog request and body reading.options.timeoutMsOptionalnumber | undefinedTotal catalog request deadline, 15000 ms by default.options.maxResponseBytesOptionalnumber | undefinedMaximum catalog response bytes, 32 MiB by default.

