Anthropic | Models

List and retrieve information about available Claude models.

List Models

Lists all available Claude models.


Anthropic := TsgcHTTP_API_Anthropic.Create(nil);
Anthropic.AnthropicOptions.ApiKey := 'API_KEY';
WriteLn(Anthropic._GetModels);

Get Model

Retrieves information about a specific model.


Anthropic := TsgcHTTP_API_Anthropic.Create(nil);
Anthropic.AnthropicOptions.ApiKey := 'API_KEY';
WriteLn(Anthropic._GetModel('claude-sonnet-4-20250514'));

Typed Response

Use the typed response class for structured access to model data.


Anthropic := TsgcHTTP_API_Anthropic.Create(nil);
Anthropic.AnthropicOptions.ApiKey := 'API_KEY';

oModels := Anthropic.GetModels;
Try
  for i := 0 to Length(oModels.Data) - 1 do
    WriteLn(oModels.Data[i].Id + ' - ' + oModels.Data[i].DisplayName);
Finally
  oModels.Free;
End;