OpenAI 取消向量存储文件批次接口
2026-11-10 18:17 更新
取消向量存储文件批次
post /vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel
取消向量存储文件批次。此操作会尝试尽快取消该批次中文件的处理。
路径参数
vector_store_id: string:此请求涉及的向量存储 ID。
batch_id: string:此请求涉及的文件批次 ID。
返回值
VectorStoreFileBatch object { id, created_at, file_counts, 3 more }
附加到向量存储的一批文件。
id: string
标识符,可在API端点中引用。
created_at: integer(Unix 时间戳)
向量存储文件批次创建时的Unix时间戳,单位为秒。
file_counts: object { cancelled, completed, failed, 2 more }
cancelled: integer
已取消的文件数量。
completed: integer
已处理的文件数量。
failed: integer
处理失败的文件数量。
in_progress: integer
正在处理的文件数量。
total: integer
文件总数。
object: "vector_store.file_batch"
对象类型,固定为vector_store.file_batch。
"vector_store.file_batch"
status: "in_progress" or "completed" or "cancelled" or "failed"
向量存储文件批次的状态,可为in_progress、completed、cancelled或failed。
"in_progress"
"completed"
"cancelled"
"failed"
vector_store_id: string
示例
## [中文] 发送POST请求;将示例API凭证及资源标识替换为应用使用的值。
curl https://api.openai.com/v1/vector_stores/$VECTOR_STORE_ID/file_batches/$BATCH_ID/cancel \
-X POST \
-H 'OpenAI-Beta: assistants=v2' \
-H "Authorization: Bearer $OPENAI_API_KEY"
响应
中文说明:以下为原文配置、命令或事件示例,字段名、枚举、标识符及数值保留。
{
"id": "id",
"created_at": 0,
"file_counts": {
"cancelled": 0,
"completed": 0,
"failed": 0,
"in_progress": 0,
"total": 0
},
"object": "vector_store.file_batch",
"status": "in_progress",
"vector_store_id": "vector_store_id"
}
示例
原文示例说明:此处URL中的files_batches与本页端点定义的file_batches不一致。调用路径应以端点定义为准;下方保留原文代码供对照,此示例未作运行验证。
## [中文] 发送POST请求;将示例API凭证及资源标识替换为应用使用的值。
curl https://api.openai.com/v1/vector_stores/vs_abc123/files_batches/vsfb_abc123/cancel \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-X POST
响应
中文说明:以下为原文配置、命令或事件示例,字段名、枚举、标识符及数值保留。
{
"id": "vsfb_abc123",
"object": "vector_store.file_batch",
"created_at": 1699061776,
"vector_store_id": "vs_abc123",
"status": "in_progress",
"file_counts": {
"in_progress": 12,
"completed": 3,
"failed": 0,
"cancelled": 0,
"total": 15
}
}以上内容是否对您有帮助:

TRAE-AI编程


更多建议: