List and retrieve information about available Claude models.
Lists all available Claude models.
Anthropic := TsgcHTTP_API_Anthropic.Create(nil);
Anthropic.AnthropicOptions.ApiKey := 'API_KEY';
WriteLn(Anthropic._GetModels);
Retrieves information about a specific model.
Anthropic := TsgcHTTP_API_Anthropic.Create(nil);
Anthropic.AnthropicOptions.ApiKey := 'API_KEY';
WriteLn(Anthropic._GetModel('claude-sonnet-4-20250514'));
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;