class

Anthropic::Models

Inherits Reference < Object

Constructors

new(client : Client)
Source

Instance methods

list(after_id : String | Nil = nil, before_id : String | Nil = nil, limit : Int32 = 20) : ModelListResponse

List all available models

Returns a paginated list of all Claude models available to your account.

client = Anthropic::Client.new
response = client.models.list
response.data.each do |model|
  puts "#{model.display_name} (#{model.id})"
end
Source
retrieve(model_id : String) : ModelInfo

Retrieve specific model information

Returns detailed information about a specific Claude model.

client = Anthropic::Client.new
model = client.models.retrieve("claude-sonnet-4-6")
puts model.display_name
Source