TsgcHTTP_API_Anthropic › Methods › ListBatches
Lists all Message Batches in the Anthropic workspace, with optional pagination
function ListBatches(const aLimit: Integer = 20; const aAfterId: string = ''; const aBeforeId: string = '') : TsgcAnthropicClass_Response_List_Batches;
| Name | Type | Description |
|---|---|---|
aLimit | const Integer | Maximum number of batches to return per page. Defaults to 20. |
aAfterId | const string | Cursor: return batches created after the batch with this id. Empty for the first page. |
aBeforeId | const string | Cursor: return batches created before the batch with this id. Empty to ignore. |
Response with a Data array of batch descriptors plus paging cursors (TsgcAnthropicClass_Response_List_Batches)
Performs a GET /v1/messages/batches request against the Anthropic Message Batches API, returning every batch submitted by the current workspace with its current processing status (in_progress, ended, canceled, etc.). Use aAfterId to walk past the first page. The anthropic-version header from AnthropicOptions is included automatically. The returned object must be freed by the caller.
oResponse := oAPI.ListBatches(20);
try
for i := 0 to oResponse.Data.Count - 1 do
Memo1.Lines.Add(oResponse.Data[i].Id + ' = ' + oResponse.Data[i].ProcessingStatus);
finally
oResponse.Free;
end;