Skip to content

Cancel a Batch

Stop the execution of a batch that has been submitted but not yet completed.

POST https://llm.siraya.ai/v1/batches/{batch_id}/cancel

Body

batch_id string Required
The unique identifier of the batch to cancel.
curl -X POST https://llm.siraya.ai/v1/batches/batch_abc123/cancel \
  -H "Authorization: Bearer <API_KEY>"
import requests

url = "https://llm.siraya.ai/v1/batches/batch_abc123/cancel"
headers = {"Authorization": "Bearer <API_KEY>"}

response = requests.post(url, headers=headers)
print(response.json())

Example Response

{
  "id": "batch_abc123",
  "status": "cancelled",
  "cancelled_at": 1700000000
}