class

Anthropic::Beta::ModelsAPI

Inherits Reference < Object

Beta-scoped Models API with automatic beta header merging.

Provides access to the Models API through the beta namespace, automatically merging any beta namespace headers with per-request options.

Usage

client = Anthropic::Client.new

# Access models through beta namespace
models = client.beta.models.list

# With custom beta headers
models = client.beta(["custom-beta"]).models.list

Constructors

new(client : Client, namespace_beta_headers : Array(String))
Source

Instance methods

list(params : ListParams = ListParams.new, request_options : RequestOptions | Nil = nil) : Page(ModelInfo)

List all available models with pagination support.

Beta namespace headers are automatically merged with any per-request options.

Source
list_all(limit : Int32 | Nil = nil, request_options : RequestOptions | Nil = nil) : AutoPaginator(ModelInfo)

Auto-paginating iterator for listing all models.

Beta namespace headers are automatically merged with any per-request options.

Example:

client.beta.models.list_all(limit: 20).each do |model|
  puts model.id
end
Source
retrieve(model_id : String, request_options : RequestOptions | Nil = nil) : ModelInfo

Retrieve a specific model by ID.

Beta namespace headers are automatically merged with any per-request options.

Source