Batches
Many users at once: one ask each, followed together.
POST/v1/batches/{batch_id}/cancelStop starting new items; running ones finish.
Request2 fields
Path
batch_idstringrequiredThe batch's id (bat_...).
- Type
string
Headers
Idempotency-KeystringSend the same key to retry this call safely for 24 hours.
- Type
string
Answers 20011 fields
idstringThe batch (bat_...).
- Example
bat_7xk
object"batch"Always batch.
- Type
"batch"
status"running" | "cancelled" | "completed"running: items are still starting or running. cancelled: you cancelled it, so no new item starts. completed: every item has finished.
- Type
"running" | "cancelled" | "completed"
deployment_idstring | nullThe deployment that answers its items (dep_...); null when none applies.
- Type
string | null
concurrencyintegerHow many items run at once.
- Type
integer
item_countintegerHow many items it has.
- Type
integer
countsobjectIts items, by status.
queuedintegerItems not started yet.
- Type
integer
runningintegerItems running now.
- Type
integer
succeededintegerItems that finished well.
- Type
integer
failedintegerItems that failed.
- Type
integer
cancelledintegerItems a cancel kept from starting.
- Type
integer
spend_usdnumberWhat it has cost so far, in billed US dollars: every item's conversation and all its work.
- Example
0.061
metadatamap of stringYour labels, as you sent them; empty when you sent none.
- Type
map of string
created_atstringWhen it was made, as an ISO 8601 time.
- Type
string
completed_atstring | nullWhen it stopped running, completed or cancelled, as an ISO 8601 time; null while running.
- Type
string | null
const batch = vestra.ask([{ user: 'traveller-42', message: 'Is your flight hit by the storm?' }]);await batch.cancel();batch = vestra.ask([{"user": "traveller-42", "message": "Is your flight hit by the storm?"}])batch.cancel()No sample in your language for this route, so here it is over HTTP.
curl -X POST "$VESTRA_BASE_URL/v1/batches/{batch_id}/cancel" \ -H "Authorization: Bearer $VESTRA_API_KEY"