curl --request POST \
--url https://api.siliconflow.com/v1/batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input_file_id": "file-jkvytbjtow",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}
'import requests
url = "https://api.siliconflow.com/v1/batches"
payload = {
"input_file_id": "file-jkvytbjtow",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input_file_id: 'file-jkvytbjtow',
endpoint: '/v1/chat/completions',
completion_window: '24h'
})
};
fetch('https://api.siliconflow.com/v1/batches', 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""404 page not found""<string>""<string>"Create batch
Upload files
curl --request POST \
--url https://api.siliconflow.com/v1/batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input_file_id": "file-jkvytbjtow",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}
'import requests
url = "https://api.siliconflow.com/v1/batches"
payload = {
"input_file_id": "file-jkvytbjtow",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input_file_id: 'file-jkvytbjtow',
endpoint: '/v1/chat/completions',
completion_window: '24h'
})
};
fetch('https://api.siliconflow.com/v1/batches', 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""404 page not found""<string>""<string>"Authorizations
Body
The ID of an uploaded file that contains requests for the new batch.
"file-jkvytbjtow"
The endpoint to be used for all requests in the batch. Currently /v1/chat/completions is supported.
"/v1/chat/completions"
The time frame within which the batch should be processed. The maximum value is 24 hours, and the minimum value is 336 hours.
"24h"
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.<\br>Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Successful response
"batch_rdyqgrcgjg"
"batch"
"/v1/chat/completions"
null
"file-jkvytbjtow"
"24h"
"in_queue"
null
null
1741685413
null
1741771813
null
null
null
null
null
null
null
Show child attributes
Show child attributes