取消批处理任务
curl --request POST \
--url https://api.moonshot.cn/v1/batches/{batch_id}/cancel \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"object": "batch",
"endpoint": "<string>",
"input_file_id": "<string>",
"completion_window": "<string>",
"created_at": 123,
"request_counts": {
"completed": 123,
"failed": 123,
"total": 123
},
"output_file_id": "<string>",
"error_file_id": "<string>",
"in_progress_at": 123,
"expires_at": 123,
"finalizing_at": 123,
"completed_at": 123,
"failed_at": 123,
"cancelling_at": 123,
"cancelled_at": 123,
"metadata": {}
}取消批处理任务
取消一个正在进行的批处理任务。取消后,任务状态将先变为 cancelling,最终变为 cancelled。仅 validating、in_progress、finalizing 状态的任务可以取消。
POST
/
v1
/
batches
/
{batch_id}
/
cancel
取消批处理任务
curl --request POST \
--url https://api.moonshot.cn/v1/batches/{batch_id}/cancel \
--header 'Authorization: Bearer <token>'{
"id": "<string>",
"object": "batch",
"endpoint": "<string>",
"input_file_id": "<string>",
"completion_window": "<string>",
"created_at": 123,
"request_counts": {
"completed": 123,
"failed": 123,
"total": 123
},
"output_file_id": "<string>",
"error_file_id": "<string>",
"in_progress_at": 123,
"expires_at": 123,
"finalizing_at": 123,
"completed_at": 123,
"failed_at": 123,
"cancelling_at": 123,
"cancelled_at": 123,
"metadata": {}
}完整的调用示例请参考 Batch API 指南。
授权
路径参数
批处理任务的 ID
响应
已取消的批处理任务
批处理任务的唯一标识符
对象类型,固定为 batch
示例:
"batch"
请求端点
输入文件 ID
任务处理时间窗口
当前状态:validating(校验中)、failed(校验失败)、in_progress(执行中)、finalizing(准备结果中)、completed(已完成)、expired(已过期)、cancelling(取消中)、cancelled(已取消)
可用选项:
validating, failed, in_progress, finalizing, completed, expired, cancelling, cancelled 创建时间(Unix 时间戳)
Show child attributes
Show child attributes
处理成功的结果文件 ID
处理失败的错误文件 ID
开始执行时间(Unix 时间戳)
过期时间(Unix 时间戳)
开始准备结果的时间(Unix 时间戳)
完成时间(Unix 时间戳)
校验失败时间(Unix 时间戳)
发起取消时间(Unix 时间戳)
取消完成时间(Unix 时间戳)
自定义元数据
Show child attributes
Show child attributes
此页面对您有帮助吗?
⌘I