Liking cljdoc? Tell your friends :D

llm.sdk.models

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.
raw docstring

explain-model-entryclj

(explain-model-entry x)
source

fetch-modelscljmultimethod

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.
sourceraw docstring

ModelCostclj

source

ModelEntryclj

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.
sourceraw docstring

parse-anthropic-modelsclj

(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, ...}.
sourceraw docstring

parse-gemini-modelsclj

(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).
sourceraw docstring

parse-openai-styleclj

(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.
sourceraw docstring

parse-openrouter-modelsclj

(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.
sourceraw docstring

supported-providersclj

Providers with a usable live /models endpoint.

Providers with a usable live /models endpoint.
sourceraw docstring

supports-models-listing?clj

(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?
sourceraw docstring

validate-model-entryclj

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close