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

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

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

snapshot version (iso date or unseeded)

Functions

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, :supported_parameter, :provider_id.

pricing(id)

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

pricing map for a model id, or nil

version()

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

snapshot version (iso date or unseeded)