Batch
GET /v1/batch/jobs
Get Batch Jobs
Get a list of batch jobs for your organization and user.
Parameters
page
integerquerypage_size
integerquerymodel
string | nullqueryagent_id
string | nullquerymetadata
map<any> | nullquerycreated_after
date-time | nullquerycreated_by_me
booleanquerystatus
array<"QUEUED" | "RUNNING" | "SUCCESS" | "FAILED" | "TIMEOUT_EXCEEDED" | "CANCELLATION_REQUESTED" | "CANCELLED"> | nullqueryorder_by
"created" | "-created"queryResponses
OK
data
array<BatchJob>BatchJob
agent_id
string | nullcompleted_at
integer | nullcompleted_requests
integer* requiredcreated_at
integer* requiredendpoint
string* requirederror_file
string | nullBatchError
count
integerDefault Value: 1
message
string* requiredfailed_requests
integer* requiredid
string* requiredinput_files
array<string>* requiredmetadata
map<any> | nullmodel
string | nullobject
stringDefault Value: "batch"
output_file
string | nulloutputs
array<map<any>> | nullstarted_at
integer | nullstatus
"QUEUED" | "RUNNING" | "SUCCESS" | "FAILED" | "TIMEOUT_EXCEEDED" | "CANCELLATION_REQUESTED" | "CANCELLED"* requiredsucceeded_requests
integer* requiredtotal_requests
integer* requiredobject
stringDefault Value: "list"
total
integer* requiredPOST /v1/batch/jobs
Create Batch Job
Create a new batch job, it will be queued for processing.
Request Example
{
"endpoint": "/v1/chat/completions"
}
Request Body
agent_id
string | nullIn case you want to use a specific agent from the deprecated agents api for batch inference, you can specify the agent ID here.
endpoint
"/v1/chat/completions" | "/v1/embeddings" | "/v1/fim/completions" | "/v1/moderations" | "/v1/chat/moderations" | "/v1/ocr" | "/v1/classifications" | "/v1/chat/classifications" | "/v1/conversations" | "/v1/audio/transcriptions"* requiredinput_files
array<string> | nullA list of .jsonl files for batch inference. Each line must be a JSON object with a body field containing the request payload:
\{"custom_id": "0", "body": \{"max_tokens": 100, "messages": [\{"role": "user", "content": "What is the best French cheese?"\}]\}\}
\{"custom_id": "1", "body": \{"max_tokens": 100, "messages": [\{"role": "user", "content": "What is the best French wine?"\}]\}\}
metadata
map<string> | nullThe metadata of your choice to be associated with the batch inference job.
model
string | nullThe model to be used for batch inference.
Examples:
mistral-small-latest
mistral-medium-latest
requests
array<BatchRequest> | nullBatchRequest
body
map<any>* requiredcustom_id
string | nulltimeout_hours
integerMin: 1Max: 168The timeout in hours for the batch inference job.
Default Value: 24
Responses
OK
agent_id
string | nullcompleted_at
integer | nullcompleted_requests
integer* requiredcreated_at
integer* requiredendpoint
string* requirederror_file
string | nullBatchError
count
integerDefault Value: 1
message
string* requiredfailed_requests
integer* requiredid
string* requiredinput_files
array<string>* requiredmetadata
map<any> | nullmodel
string | nullobject
stringDefault Value: "batch"
output_file
string | nulloutputs
array<map<any>> | nullstarted_at
integer | nullstatus
"QUEUED" | "RUNNING" | "SUCCESS" | "FAILED" | "TIMEOUT_EXCEEDED" | "CANCELLATION_REQUESTED" | "CANCELLED"* requiredsucceeded_requests
integer* requiredtotal_requests
integer* requiredGET /v1/batch/jobs/{job_id}
Get Batch Job
Get a batch job details by its UUID.
Args: inline: If True, return results inline in the response.
Parameters
job_id
stringpath* requiredinline
boolean | nullqueryResponses
OK
agent_id
string | nullcompleted_at
integer | nullcompleted_requests
integer* requiredcreated_at
integer* requiredendpoint
string* requirederror_file
string | nullBatchError
count
integerDefault Value: 1
message
string* requiredfailed_requests
integer* requiredid
string* requiredinput_files
array<string>* requiredmetadata
map<any> | nullmodel
string | nullobject
stringDefault Value: "batch"
output_file
string | nulloutputs
array<map<any>> | nullstarted_at
integer | nullstatus
"QUEUED" | "RUNNING" | "SUCCESS" | "FAILED" | "TIMEOUT_EXCEEDED" | "CANCELLATION_REQUESTED" | "CANCELLED"* requiredsucceeded_requests
integer* requiredtotal_requests
integer* requiredDELETE /v1/batch/jobs/{job_id}
Delete Batch Job
Request the deletion of a batch job.
Parameters
job_id
stringpath* requiredResponses
OK
deleted
booleanDefault Value: true
id
string* requiredobject
stringDefault Value: "batch"
POST /v1/batch/jobs/{job_id}/cancel
Cancel Batch Job
Request the cancellation of a batch job.
Parameters
job_id
stringpath* requiredResponses
OK
agent_id
string | nullcompleted_at
integer | nullcompleted_requests
integer* requiredcreated_at
integer* requiredendpoint
string* requirederror_file
string | nullBatchError
count
integerDefault Value: 1
message
string* requiredfailed_requests
integer* requiredid
string* requiredinput_files
array<string>* requiredmetadata
map<any> | nullmodel
string | nullobject
stringDefault Value: "batch"