TsgcHTTP_API_Anthropic › Methods › CancelBatch
Cancels an in-progress Message Batch on the Anthropic API
function CancelBatch(const aBatchId: string) : TsgcAnthropicClass_Response_Batch;
| Name | Type | Description |
|---|---|---|
aBatchId | const string | Identifier of the batch to cancel, typically starting with msgbatch_. |
Updated batch descriptor with its new ProcessingStatus set to canceling or ended (TsgcAnthropicClass_Response_Batch)
Sends a POST /v1/messages/batches/{id}/cancel request to the Anthropic API. Requests that have already begun processing inside the batch will still be billed; unprocessed requests will be aborted. The anthropic-version header from AnthropicOptions is included automatically. The returned object must be freed by the caller.
oResponse := oAPI.CancelBatch('msgbatch_01AbCdEf');
try
ShowMessage('new status: ' + oResponse.ProcessingStatus);
finally
oResponse.Free;
end;