Anthropic Models API - List and retrieve available Claude models.
Functions
get
fn (model_id: Str): Model
fn (model_id: Str, opts: Map): Model
GET /v1/models/{model_id} - Retrieve a specific model.
Returns details about a specific model, including its id, display_name,
type, and created_at timestamp.
Example
model ::anthropic::models/get("claude-sonnet-4-20250514")
model.id // => "claude-sonnet-4-20250514"
model.display_name // => "Claude Sonnet 4"
model.created_at // => "2025-05-14T..."
list
fn (): ModelsListResponse
fn (opts: Map): ModelsListResponse
fn (limit: Int): ModelsListResponse
fn (limit: Int, opts: Map): ModelsListResponse
fn (limit: Int, after_id: Str): ModelsListResponse
fn (limit: Int, after_id: Str, opts: Map): ModelsListResponse
GET /v1/models - List available Claude models.
Returns a paginated list of models available to your API key. Each model
includes an id, display_name, type, and created_at timestamp.
Optionally pass a limit to control page size, and after_id for
cursor-based pagination.
Example
// List all models
models ::anthropic::models/list()
first-model first(models.data)
first-model.id // => "claude-sonnet-4-20250514"
first-model.display_name // => "Claude Sonnet 4"
// List with a limit
models ::anthropic::models/list(2)
assert(lte(length(models.data), 2))
// Paginate through results
page1 ::anthropic::models/list(10)
if(page1.has_more, ::anthropic::models/list(10, page1.last_id), page1)
Types
Model
Model type {
id: Str,
type: Str,
display_name: Str,
created_at: Str
}
ModelsListResponse
ModelsListResponse type {
data: Vec<Model>,
has_more: Bool,
first_id: Str?,
last_id: Str?
}