Overview
This API is used to cancel a specified batch task. Currently, this API is supported only by Alibaba Cloud's Qwen series of models.
API details
Constraints
- You must have an API Key. For more information, see Manage AI API Keys.
Request path
POST {BASE_URL}/api/v1/batches/{batch_id}/cancel
Request header
Name |
Required |
Example value |
Description |
|---|---|---|---|
| Authorization | Yes | Bearer {token} | Authentication information |
| Content-Type | No | application/json | Request body format |
Request parameters
Path parameters
Name |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| batch_id | string | Yes | batch_abc123 | Batch Task ID |
Query
None
Body
None
Response
Response parameters
Name |
Type |
Description |
|---|---|---|
| success | boolean | Whether the request was successful |
| code | string | Response code |
| message | string | Response information |
| data | object | Business response data |
data
Name |
Type |
Description |
|---|---|---|
| id | string | Unique ID of the batch task |
| status | string | Batch task status |
Request example
curl --request POST '{BASE_URL}/api/v1/batches/batch_abc123/cancel' \
--header 'Authorization: Bearer {token}'
Response example
{
"success": true,
"code": "200",
"message": "successful",
"data": {
"id": "batch_abc123",
"status": "cancelled"
}
}
