The Models API: list available Claude models, retrieve a specific model, and look up per-model capabilities.
Results are cached in an ETS table owned by the application supervisor.
Pass cache: false to bypass the cache. Configure the TTL with
config :req_anthropic, models_cache_ttl: :timer.hours(2).
Summary
Functions
Return the static capabilities table for a model id (or %Model{} struct).
Drop everything from the cache.
Retrieve a single model by id.
Same as get/2 but raises on error.
List all models available to your API key. Paginates the API
transparently and returns a list of %ReqAnthropic.Model{}.
Same as list/1 but raises on error.
Functions
@spec capabilities(String.t() | ReqAnthropic.Model.t()) :: ReqAnthropic.Model.Capabilities.t()
Return the static capabilities table for a model id (or %Model{} struct).
@spec clear_cache() :: :ok
Drop everything from the cache.
@spec get( String.t(), keyword() ) :: {:ok, ReqAnthropic.Model.t()} | {:error, ReqAnthropic.Error.t() | Exception.t()}
Retrieve a single model by id.
@spec get!( String.t(), keyword() ) :: ReqAnthropic.Model.t()
Same as get/2 but raises on error.
@spec list(keyword()) :: {:ok, [ReqAnthropic.Model.t()]} | {:error, ReqAnthropic.Error.t() | Exception.t()}
List all models available to your API key. Paginates the API
transparently and returns a list of %ReqAnthropic.Model{}.
@spec list!(keyword()) :: [ReqAnthropic.Model.t()]
Same as list/1 but raises on error.