docs
0
# Batch Processing
1
2
Batch API for processing large volumes of requests efficiently with cost optimization and result management.
3
4
## Capabilities
5
6
```python { .api }
7
class Batches:
8
def create(self, **kwargs): ...
9
def list(self, **kwargs): ...
10
def retrieve(self, **kwargs): ...
11
def cancel(self, **kwargs): ...
12
```
13
14
## Usage Examples
15
16
```python
17
# Create batch job
18
batch = portkey.batches.create(
19
input_file_id="file-123",
20
endpoint="/v1/chat/completions",
21
completion_window="24h"
22
)
23
24
# Check batch status
25
batch_status = portkey.batches.retrieve(batch.id)
26
```