Create batch
Batch
Batches (Beta)
Create an async batch job and attach observability metadata such as session ids and webhooks.
POST
Create batch
Creates an async batch job.
AI Stats also accepts these extra fields:
session_idto group the batch with related requests in logs and activity viewswebhookto configure async notifications when the batch transitions state.metadatato persist caller-defined tags alongside the batch.
GET /batches/{batch_id} to poll status and POST /batches/{batch_id}/cancel to stop a pending or processing batch.
Batch responses can also include:
request_idprovider- echoed
session_id - echoed
webhook - terminal
billingsummary data - terminal
pricing_lines
Authorizations
Bearer token authentication
Body
application/json
Unique identifier for grouping related requests (for example, a conversation or agent workflow) for observability.
Maximum string length:
256Gateway debug controls. These flags are never forwarded upstream.
Provider routing preferences for gateway selection.
Response
Batch status response
Last modified on May 19, 2026