OpenrouterSdk.Catalog.Models (OpenRouter SDK v0.1.1)

Copy Markdown View Source

hard-coded snapshot of /api/v1/models.

embedded into the beam at compile time so lookups are zero-io. the contents are managed by mix openrouter.snapshot and kept fresh by ci — see .github/workflows/openrouter-drift.yml.

the catalog is purely informational. nothing in this sdk validates that a model id passed to Api.Chat.completions/2 exists here — consumers can use this list to drive their own routing / rotation / fallback policies.

Summary

Functions

models capable of audio -> text — i.e. speech-to-text via the documented /chat/completions input_audio content block. this is the working path for stt on openrouter; the dedicated /audio/transcriptions endpoint silently rejects multipart bodies. see OpenrouterSdk.transcribe/2 for the higher-level helper.

models capable of text -> text chat completions. handy default for populating a "pick a model" ui.

context length for a model id, or nil

lookup by id, returns nil if absent

all models in the snapshot

filter the snapshot.

pricing map for a model id, or nil

models capable of text -> audio — i.e. text-to-speech. note that this also includes conversational audio models (gpt-audio etc.) that happen to be tts-capable.

snapshot version (iso date or unseeded)

Functions

audio_input_models()

@spec audio_input_models() :: [map()]

models capable of audio -> text — i.e. speech-to-text via the documented /chat/completions input_audio content block. this is the working path for stt on openrouter; the dedicated /audio/transcriptions endpoint silently rejects multipart bodies. see OpenrouterSdk.transcribe/2 for the higher-level helper.

chat_models()

@spec chat_models() :: [map()]

models capable of text -> text chat completions. handy default for populating a "pick a model" ui.

context_length(id)

@spec context_length(String.t()) :: integer() | nil

context length for a model id, or nil

get(id)

@spec get(String.t()) :: map() | nil

lookup by id, returns nil if absent

list()

@spec list() :: [map()]

all models in the snapshot

list(filters)

@spec list(keyword()) :: [map()]

filter the snapshot.

supported keys: :modality, :input_modality, :output_modality, :supported_parameter, :provider_id.

pricing(id)

@spec pricing(String.t()) :: map() | nil

pricing map for a model id, or nil

tts_models()

@spec tts_models() :: [map()]

models capable of text -> audio — i.e. text-to-speech. note that this also includes conversational audio models (gpt-audio etc.) that happen to be tts-capable.

version()

@spec version() :: String.t()

snapshot version (iso date or unseeded)