Batches
Many users at once: one ask each, followed together.
GET/v1/batches/{batch_id}Progress: counts by status, spend so far.
Request1 field
Path
batch_idstringrequiredThe batch's id (bat_...).
- 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?' }]);const progress = await batch.get();batch = vestra.ask([{"user": "traveller-42", "message": "Is your flight hit by the storm?"}])progress = batch.get()vestra events bat_7xk# Its status and counts, then each item's text: the work's answer.curl "$VESTRA_BASE_URL/v1/batches/bat_7xk" \ -H "Authorization: Bearer $VESTRA_API_KEY" curl "$VESTRA_BASE_URL/v1/batches/bat_7xk/items" \ -H "Authorization: Bearer $VESTRA_API_KEY"No sample in your language for this route, so here it is over HTTP.
# Its status and counts, then each item's text: the work's answer.curl "$VESTRA_BASE_URL/v1/batches/bat_7xk" \ -H "Authorization: Bearer $VESTRA_API_KEY" curl "$VESTRA_BASE_URL/v1/batches/bat_7xk/items" \ -H "Authorization: Bearer $VESTRA_API_KEY"