Claudio.Models (Claudio v0.6.0)
View SourceAnthropic Models API client.
Discover available Claude models and their capabilities at runtime. GA — no beta header required.
Example
client = Claudio.Client.new(%{token: "sk-ant-...", version: "2023-06-01"})
{:ok, %{"data" => models}} = Claudio.Models.list(client, limit: 20)
{:ok, model} = Claudio.Models.get(client, "claude-opus-4-8")
Summary
Functions
Retrieves a single model by id or alias.
Lists available models (most recently released first), paginated.
Functions
@spec get(Req.Request.t(), String.t()) :: {:ok, map()} | {:error, Claudio.APIError.t() | term()}
Retrieves a single model by id or alias.
Parameters
client— AReq.RequestfromClaudio.Client.new/2.model_id— A model id or alias (e.g."claude-opus-4-8").
Returns
{:ok, %{"id" => _, "type" => "model", "display_name" => _, "created_at" => _}}on success (may also includemax_input_tokens/max_tokens/capabilities).{:error, %Claudio.APIError{}}on a non-200 response.{:error, term()}on a transport/Req error.
@spec list( Req.Request.t(), keyword() ) :: {:ok, map()} | {:error, Claudio.APIError.t() | term()}
Lists available models (most recently released first), paginated.
Parameters
client— AReq.RequestfromClaudio.Client.new/2.opts— Optional keyword list::limit— Number of models to return (default server-side: 20).:before_id— Cursor for the previous page (model id).:after_id— Cursor for the next page (model id).
Returns
{:ok, %{"data" => [...], "first_id" => _, "last_id" => _, "has_more" => _}}on success.{:error, %Claudio.APIError{}}on a non-200 response.{:error, term()}on a transport/Req error.