Per-provider /models endpoint fetchers.
Each supported provider has a fetcher that hits its public /models endpoint and returns a vector of normalized ModelEntry maps with :model/source :live-models-api.
The registry layer (llm.sdk.registry) merges these entries with the models.dev breadth registry and a bundled offline snapshot to produce one unified view per (provider, model).
Providers without a public /models endpoint (Codex, Codex-backend, Bedrock, Fake) throw :error :unsupported on fetch - callers should route those through models.dev / snapshot layers only.
Per-provider /models endpoint fetchers. Each supported provider has a fetcher that hits its public /models endpoint and returns a vector of normalized ModelEntry maps with :model/source :live-models-api. The registry layer (llm.sdk.registry) merges these entries with the models.dev breadth registry and a bundled offline snapshot to produce one unified view per (provider, model). Providers without a public /models endpoint (Codex, Codex-backend, Bedrock, Fake) throw :error :unsupported on fetch - callers should route those through models.dev / snapshot layers only.
Fetch the live model catalog for a provider. Returns a vector of ModelEntry maps tagged with :model/source :live-models-api. Throws ex-info on auth / HTTP / unsupported.
Fetch the live model catalog for a provider. Returns a vector of ModelEntry maps tagged with :model/source :live-models-api. Throws ex-info on auth / HTTP / unsupported.
Canonical model registry entry. Every layer (live /models, models.dev, bundled snapshot) emits maps of this shape; :model/source tags the producing layer.
Canonical model registry entry. Every layer (live /models, models.dev, bundled snapshot) emits maps of this shape; :model/source tags the producing layer.
(parse-anthropic-models body provider-id source-url)Shape: {data [{type, id, display_name, created_at}], has_more, ...}.
Shape: {data [{type, id, display_name, created_at}], has_more, ...}.
(parse-gemini-models body provider-id source-url)Shape (Gemini Native + Vertex): Native - {models [{name 'models/gemini-2.5-pro', ...}]} Vertex - {publisherModels [{name 'publishers/google/models/...', ...}]} Each entry carries displayName, inputTokenLimit, outputTokenLimit, supportedGenerationMethods (mapped to capability keywords).
Shape (Gemini Native + Vertex):
Native - {models [{name 'models/gemini-2.5-pro', ...}]}
Vertex - {publisherModels [{name 'publishers/google/models/...', ...}]}
Each entry carries displayName, inputTokenLimit, outputTokenLimit,
supportedGenerationMethods (mapped to capability keywords).(parse-openai-style body provider-id source-url)Shape: {object 'list', data [{id, object, created, owned_by}]}. Used by OpenAI, DeepSeek, Kimi - none surface context length or pricing via /models, so entries are id-only.
Shape: {object 'list', data [{id, object, created, owned_by}]}.
Used by OpenAI, DeepSeek, Kimi - none surface context length or
pricing via /models, so entries are id-only.(parse-openrouter-models body provider-id source-url)Shape: {data [{id, name, context_length, pricing {prompt, completion, request, image, cache_read, cache_write, ...}, architecture {modality, tokenizer, instruct_type}, top_provider {context_length, max_completion_tokens, is_moderated}, per_request_limits}]}. Per-token pricing strings are converted to per-million USD numbers.
Shape: {data [{id, name, context_length,
pricing {prompt, completion, request, image, cache_read,
cache_write, ...},
architecture {modality, tokenizer, instruct_type},
top_provider {context_length, max_completion_tokens,
is_moderated},
per_request_limits}]}.
Per-token pricing strings are converted to per-million USD numbers.Providers with a usable live /models endpoint.
Providers with a usable live /models endpoint.
(supports-models-listing? provider-id)Does this provider expose a /models endpoint we can call?
Does this provider expose a /models endpoint we can call?
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |