POST /api/v1/batch
Response
cost_cents on each result is that item’s real metered charge for its actual token usage — not a fixed per-model number, so the same prompt on the same model can bill slightly differently between runs.
Results come back in request order, tagged by index. Each also carries tokens and (for auto) a routing object.
Parameters
Billing: each successful request bills its exact metered token usage at that model’s $/MTok rate; failures aren’t charged. An estimated maximum for the whole batch is held against your balance up front and the unused portion refunds once every item completes.
Streaming results
Setstream: true to get each result the moment it finishes instead of waiting for the slowest one — useful when a couple of the 20 prompts are much slower than the rest:
POST /api/v1/batch (stream)
text/event-stream: one type: "result" event per completed request (in whatever order they finish, tagged by index), followed by one final type: "summary" event and a [DONE] sentinel:
summary event fires.