Batches
The ID of an uploaded file that contains requests for the new batch.
Your input file must be formatted as a JSONL file, and must be uploaded with the purpose set to "batch". The file can contain up to 50,000 requests, and can be up to 200 MB in size.
file-abc123The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/embeddings, and /v1/completions are supported.
The time frame within which the batch should be processed. Currently only "24h" is supported.
24hExample: 24hPossible values: Batch retrieval response
A batch object representing a collection of requests processed together.
The unique identifier of the batch.
batch_abc123The object type, which is always "batch".
batchPossible values: The endpoint used for the batch requests.
/v1/chat/completionsPossible values: The ID of the input file used for the batch.
file-abc123The time frame within which the batch should be processed.
24hThe current status of the batch.
completedPossible values: The ID of the file containing the outputs of the batch requests. This is only available when the batch status is "completed".
file-xyz789The ID of the file containing the errors of the batch requests. This is only available when there are errors in the batch.
file-error123The Unix timestamp (in seconds) for when the batch was created.
1714508400The Unix timestamp (in seconds) for when the batch started processing.
1714508460The Unix timestamp (in seconds) for when the batch will expire.
1714594800The Unix timestamp (in seconds) for when the batch started finalizing.
1714510200The Unix timestamp (in seconds) for when the batch was completed.
1714510260The Unix timestamp (in seconds) for when the batch failed.
1714510300The Unix timestamp (in seconds) for when the batch expired.
1714594800The Unix timestamp (in seconds) for when the batch cancellation was initiated.
1714509000The Unix timestamp (in seconds) for when the batch was cancelled.
1714509060Invalid request data.
Server error.
POST /v1/batches HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 91
{
"input_file_id": "file-abc123",
"endpoint": "/v1/chat/completions",
"completion_window": "24h"
}{
"id": "batch_abc123",
"object": "batch",
"endpoint": "/v1/chat/completions",
"errors": {
"object": "list",
"data": [
{
"code": "invalid_request",
"message": "The request was malformed",
"param": "messages",
"line": 42
}
]
},
"input_file_id": "file-abc123",
"completion_window": "24h",
"status": "completed",
"output_file_id": "file-xyz789",
"error_file_id": "file-error123",
"created_at": 1714508400,
"in_progress_at": 1714508460,
"expires_at": 1714594800,
"finalizing_at": 1714510200,
"completed_at": 1714510260,
"failed_at": 1714510300,
"expired_at": 1714594800,
"cancelling_at": 1714509000,
"cancelled_at": 1714509060,
"request_counts": {
"total": 1000,
"completed": 950,
"failed": 50
},
"metadata": {
"customer_id": "user-456",
"batch_description": "nightly-eval"
}
}The ID of the batch to retrieve
batch_abc123Batch retrieval response
A batch object representing a collection of requests processed together.
The unique identifier of the batch.
batch_abc123The object type, which is always "batch".
batchPossible values: The endpoint used for the batch requests.
/v1/chat/completionsPossible values: The ID of the input file used for the batch.
file-abc123The time frame within which the batch should be processed.
24hThe current status of the batch.
completedPossible values: The ID of the file containing the outputs of the batch requests. This is only available when the batch status is "completed".
file-xyz789The ID of the file containing the errors of the batch requests. This is only available when there are errors in the batch.
file-error123The Unix timestamp (in seconds) for when the batch was created.
1714508400The Unix timestamp (in seconds) for when the batch started processing.
1714508460The Unix timestamp (in seconds) for when the batch will expire.
1714594800The Unix timestamp (in seconds) for when the batch started finalizing.
1714510200The Unix timestamp (in seconds) for when the batch was completed.
1714510260The Unix timestamp (in seconds) for when the batch failed.
1714510300The Unix timestamp (in seconds) for when the batch expired.
1714594800The Unix timestamp (in seconds) for when the batch cancellation was initiated.
1714509000The Unix timestamp (in seconds) for when the batch was cancelled.
1714509060Invalid batch ID format or malformed request
Batch not found
Internal server error
GET /v1/batches/{batch_id} HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": "batch_abc123",
"object": "batch",
"endpoint": "/v1/chat/completions",
"errors": {
"object": "list",
"data": [
{
"code": "invalid_request",
"message": "The request was malformed",
"param": "messages",
"line": 42
}
]
},
"input_file_id": "file-abc123",
"completion_window": "24h",
"status": "completed",
"output_file_id": "file-xyz789",
"error_file_id": "file-error123",
"created_at": 1714508400,
"in_progress_at": 1714508460,
"expires_at": 1714594800,
"finalizing_at": 1714510200,
"completed_at": 1714510260,
"failed_at": 1714510300,
"expired_at": 1714594800,
"cancelling_at": 1714509000,
"cancelled_at": 1714509060,
"request_counts": {
"total": 1000,
"completed": 950,
"failed": 50
},
"metadata": {
"customer_id": "user-456",
"batch_description": "nightly-eval"
}
}Last updated

