创建 batch
/v1/batches基于已上传的 JSONL 输入文件(purpose=batch)创建异步 batch 作业。平台会校验文件、要求全文件单一 body.model、锁定一条上游路由并入队提交。
MVP 仅支持 endpoint=/v1/chat/completions 与 completion_window=24h。
JSONL 格式与约束见 批量任务。
Authentication
Authorization Bearer
Request Body
input_file_idstringrequiredFile ID from POST /v1/files with purpose=batch.
endpointstringMust be /v1/chat/completions (default if omitted).
completion_windowstringMust be 24h (default if omitted).
callback_urlstringOptional HTTPS URL for terminal-state webhook. Overrides account default batch webhook when set.
metadataobjectOptional key/value metadata stored on the batch object.
Response
idstringBatch ID (batch_ prefix).
objectstringbatch
endpointstring/v1/chat/completions
statusstringvalidating, then in_progress, etc.
Available options: validating failed in_progress finalizing completed expired cancelling cancelled
input_file_idstringInput file ID.
output_file_idstringSet when completed.
error_file_idstringSet when partial failures or errors are written.
completion_windowstring24h
request_countsobjecttotal, completed, failed counts when available.
created_atintegerUnix timestamp.
expires_atintegerUnix timestamp (created + 24h).
metadataobjectEcho of request metadata.
Common errors
batch_multiple_models | More than one distinct body.model in the input file. |
batch_invalid_jsonl | Malformed line or invalid fields. |
batch_model_not_supported | Model has no batch-capable provider route. |
batch_routing_unavailable | No active SKU for the model. |
上一篇
上传 batch 输入文件
下一篇
查询 batch