Documentation
BatchResource
Access via client.batch
get_status()
Get current status of a batch operation
async def get_status(batch_id: str) -> BatchStatusResultReturns: BatchStatusResult - Status, progress_percentage, total_items, processed_items, failed_items
get_results()
Get results of a batch operation
async def get_results( batch_id: str, *, include_failed: bool = True, offset: int = 0, limit: int = 100,) -> BatchResultsReturns: BatchResults - Items, pagination, and summary
get_all_results()
Auto-paginating async iterator that yields all results for a batch
async def get_all_results( batch_id: str, *, include_failed: bool = True, page_size: int = 100,) -> AsyncIterator[BatchItemResult]Yields: BatchItemResult objects one at a time, automatically paginating through all results
cancel()
Cancel a pending or processing batch
async def cancel(batch_id: str) -> Nonewait_for_completion()
Poll until batch reaches terminal state
async def wait_for_completion( batch_id: str, *, timeout: Optional[float] = None, poll_interval: Optional[float] = None, on_progress: Optional[Callable[[BatchStatusResult], None]] = None,) -> BatchStatusResultRaises TimeoutError if timeout exceeded, BatchError if batch fails
Batch Processing
For batch image processing, use client.upload() with multiple files. This handles the complete workflow with auto-describe.