batch holds up to 10,000 requests. Each request twins one input file and ends with one result: an output file or an error. A single trace is a batch of one request.
Send Metaphi-Version: 2026-11-25. See API versions.
The batch object
Batch statuses
A batch not ended 7 days after creation, excluding time in
requires_action, expires: its open requests become expired.
The request object
A request has no id of its own. It is named by itsbatch_id and your custom_id.
Request statuses
A request starts
queued and ends in one of the four final statuses. It can end without running: canceled by a cancel, failed if its input is refused or credit ran out before it could run, or expired with its batch. While queued or running it can move to requires_action and back. It never leaves a final status.
Charges
A succeeded request is charged your organization’s price. Failed, canceled and expired requests are never charged. Test mode is free. To reconcile, listGET /v1/kennet/balance_transactions. Each transaction of type usage carries the batch_id and custom_id of the request it charged.
Create a batch
POST /v1/kennet/batches
Send JSON with an Idempotency-Key header. Maximum body size: 4 MiB.
202 with a batch in in_progress, or requires_action if prepaid credit is exhausted. If any request is invalid, nothing is created: 400 parameter_invalid names it, such as requests.3.input_file_id.
Retrieve a batch
GET /v1/kennet/batches/{batch_id}
Returns a batch. Poll no more than once every 30 seconds, or use events.
List batches
GET /v1/kennet/batches
Newest first. limit 1 to 100 (default 10); starting_after a batch id.
List a batch’s requests
GET /v1/kennet/batches/{batch_id}/requests
In the order sent. limit 1 to 100 (default 100); starting_after a custom_id; status one request status.
Retrieve a request
GET /v1/kennet/batches/{batch_id}/requests/{custom_id}
Returns a batch_request.
Download a batch’s results
GET /v1/kennet/batches/{batch_id}/results
One batch_request per line, as JSON Lines, in the order sent. Available once the batch has ended, else 409 resource_not_ready. Results never change after the batch ends, except that an output’s filename becomes null once the file is forgotten.
Cancel a batch
POST /v1/kennet/batches/{batch_id}/cancel
Requests not yet started become canceled; running requests finish. Returns the batch in canceling. It becomes ended when its running requests end. 409 resource_state if it has ended.
For a batch of one made by POST /v1/kennet/twins in 2026-10-11, a request not yet started becomes canceled and the batch ended. A running request is not canceled: the batch is returned in_progress and ends when the request does.