API Reference
- Introduction
- Authentication
- Headers
- Errors
- Supported Providers
- SDKs
- API Details
Chat Completions
Portkey Endpoints
Embeddings
Other APIs
Completions
Moderations
Fine-tuning
Assistants
- Assistants
- Threads
- Messages
- Runs
- Run Steps
List Batch
curl https://api.portkey.ai/v1/batches?limit=2 \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
-H "Content-Type: application/json"
{
"data": [
{
"id": "<string>",
"object": "batch",
"endpoint": "<string>",
"errors": {
"object": "<string>",
"data": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>",
"line": 123
}
]
},
"input_file_id": "<string>",
"completion_window": "<string>",
"status": "validating",
"output_file_id": "<string>",
"error_file_id": "<string>",
"created_at": 123,
"in_progress_at": 123,
"expires_at": 123,
"finalizing_at": 123,
"completed_at": 123,
"failed_at": 123,
"expired_at": 123,
"cancelling_at": 123,
"cancelled_at": 123,
"request_counts": {
"total": 123,
"completed": 123,
"failed": 123
},
"metadata": {}
}
],
"first_id": "batch_abc123",
"last_id": "batch_abc456",
"has_more": true,
"object": "list"
}
Query Parameters
A cursor for use in pagination. after
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Response
The object type, which is always batch
.
batch
The Portkey API endpoint used by the batch.
The ID of the input file for the batch.
The time frame within which the batch should be processed.
The current status of the batch.
validating
, failed
, in_progress
, finalizing
, completed
, expired
, cancelling
, cancelled
The Unix timestamp (in seconds) for when the batch was created.
The object type, which is always list
.
An error code identifying the error type.
A human-readable message providing more details about the error.
The name of the parameter that caused the error, if applicable.
The line number of the input file where the error occurred, if applicable.
The ID of the file containing the outputs of successfully executed requests.
The ID of the file containing the outputs of requests with errors.
The Unix timestamp (in seconds) for when the batch started processing.
The Unix timestamp (in seconds) for when the batch will expire.
The Unix timestamp (in seconds) for when the batch started finalizing.
The Unix timestamp (in seconds) for when the batch was completed.
The Unix timestamp (in seconds) for when the batch failed.
The Unix timestamp (in seconds) for when the batch expired.
The Unix timestamp (in seconds) for when the batch started cancelling.
The Unix timestamp (in seconds) for when the batch was cancelled.
The request counts for different statuses within the batch.
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. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
list
"batch_abc123"
"batch_abc456"
Was this page helpful?
curl https://api.portkey.ai/v1/batches?limit=2 \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
-H "Content-Type: application/json"
{
"data": [
{
"id": "<string>",
"object": "batch",
"endpoint": "<string>",
"errors": {
"object": "<string>",
"data": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>",
"line": 123
}
]
},
"input_file_id": "<string>",
"completion_window": "<string>",
"status": "validating",
"output_file_id": "<string>",
"error_file_id": "<string>",
"created_at": 123,
"in_progress_at": 123,
"expires_at": 123,
"finalizing_at": 123,
"completed_at": 123,
"failed_at": 123,
"expired_at": 123,
"cancelling_at": 123,
"cancelled_at": 123,
"request_counts": {
"total": 123,
"completed": 123,
"failed": 123
},
"metadata": {}
}
],
"first_id": "batch_abc123",
"last_id": "batch_abc456",
"has_more": true,
"object": "list"
}