批量处理
创建batch任务
Upload files
POST
/
batches
curl --request POST \
--url https://api.siliconflow.cn/v1/batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"input_file_id": "file-jkvytbjtow",
"endpoint": "/v1/chat/completions",
"completion_window": "24h",
"metadata": {
"description": "nightly eval job"
},
"replace": {
"model": "deepseek-ai/DeepSeek-V3"
}
}'
{
"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"
}
}
Authorizations
Use the following format for authentication: Bearer <your api key>
Body
application/json
Response
200
application/json
Successful response
The response is of type object
.
curl --request POST \
--url https://api.siliconflow.cn/v1/batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"input_file_id": "file-jkvytbjtow",
"endpoint": "/v1/chat/completions",
"completion_window": "24h",
"metadata": {
"description": "nightly eval job"
},
"replace": {
"model": "deepseek-ai/DeepSeek-V3"
}
}'
{
"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"
}
}