Skip to main content
POST
/
batches
/
{batch_id}
/
cancel
Cancel a specific batch
curl --request POST \
  --url https://api.siliconflow.cn/v1/batches/{batch_id}/cancel \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.siliconflow.cn/v1/batches/{batch_id}/cancel"

headers = {"Authorization": "Bearer <token>"}

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

print(response.text)
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.siliconflow.cn/v1/batches/{batch_id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "id": "batch_rdyqgrcgjg",
  "object": "batch",
  "endpoint": "/v1/chat/completions",
  "errors": null,
  "input_file_id": "file-jkvytbjtow",
  "completion_window": "24h",
  "status": "in_queue",
  "output_file_id": null,
  "error_file_id": null,
  "created_at": 1741685413,
  "in_progress_at": null,
  "expires_at": 1741771813,
  "finalizing_at": null,
  "completed_at": null,
  "failed_at": null,
  "expired_at": null,
  "cancelling_at": null,
  "cancelled_at": null,
  "request_counts": null,
  "metadata": {
    "description": "nightly eval job"
  }
}
{
"code": 20012,
"message": "<string>",
"data": "<string>"
}
"Invalid token"
"Forbidden"
"404 page not found"
{
"code": 50505,
"message": "Model service overloaded. Please try again later.",
"data": "<string>"
}
"<string>"

Authorizations

Authorization
string
header
required

Use the following format for authentication: Bearer

Path Parameters

batchId
string
required

Unique identifier of the batch to cancel

Response

Successful response

id
string
Example:

"batch_rdyqgrcgjg"

object
string
Example:

"batch"

endpoint
string
Example:

"/v1/chat/completions"

errors
string[]
Example:

null

input_file_id
string
Example:

"file-jkvytbjtow"

completion_window
string
Example:

"24h"

status
string
Example:

"in_queue"

output_file_id
string
Example:

null

error_file_id
string
Example:

null

created_at
integer
Example:

1741685413

in_progress_at
integer
Example:

null

expires_at
integer
Example:

1741771813

finalizing_at
integer
Example:

null

completed_at
integer
Example:

null

failed_at
integer
Example:

null

expired_at
integer
Example:

null

cancelling_at
integer
Example:

null

cancelled_at
integer
Example:

null

request_counts
object
Example:

null

metadata
object