Skip to main content
Three endpoints create many tasks in one request. Each one creates ordinary tasks: polling, webhooks, credits and plan limits are the same as for a single task.

Compare the three endpoints

Which one to use

  • Up to 500 tasks, and you handle retries: POST /v1/async/task/batch. You get every task id in the response.
  • More tasks than your plan’s concurrency, or a daily job of thousands: POST /v1/batches. The server holds the items and feeds them in as your plan limit and each engine’s queue allow, so you do not retry 429s or 503s yourself.
  • One prompt asked from many points around a place: POST /v1/async/task/grid.

POST /v1/async/task/batch

Send an array of up to 500 task requests (reference). Engines can be mixed.
A well-formed request returns 200. results[i].index matches the position in your array, and each result has either task or error:
The whole request is refused, with no task created, in these cases: A repeated idempotencyKey returns the existing task as a success. See Idempotency.

POST /v1/batches

Send up to 10,000 items (reference). Each item takes the task fields taskType, payload, priority and idempotencyKey, plus an optional customId (up to 128 characters) that is echoed in results. Set webhook.url on the batch, not on items.
The response is 202 with the batch. The first items are already submitted:

Envelope rules

All-or-nothing validation

Every item runs the same checks as a single task before anything is stored: fields, key scope, private engines, dedicated endpoints, region and payload.location. If any item fails, the response is 400 VALIDATION_ERROR, nothing is stored, and details lists up to 50 failing items:

How items run

The batch releases items as tasks when your plan limit and the engine’s queue have room. Accounts take turns, so a large batch does not hold up a small one from another account. Each released item goes through the same admission as a single task: it places a credit hold and counts against the key’s daily credit limit. When an item is refused, the code decides what happens: The batch becomes COMPLETED when no item is pending and every task has finished. With webhook.url, the server then posts the batch.completed event.

Read progress and results

GET /v1/batches/{id} returns the batch with counts by item status: pending, queued, processing, completed, failed, rejected. Polling it also moves pending items along.
GET /v1/batches/{id}/items lists items in submission order:
A REJECTED item carries error: { code, message }. Result bodies are included only within the 24-hour polling window of Async tasks. See also Get a batch and List batch items.

POST /v1/async/task/grid

Ask one prompt from every point of a square grid around a center (reference). Each point becomes a task with that point as payload.location, so the engine must take a location: CHATGPT, GEMINI, GOOGLE, AIMODE or GOOGLE_SERP. Do not send payload.location yourself.
Row 0 is the north edge and column 0 the west edge. The response returns grid (with id and spacingMeters), a summary, and points in row order, each with row, col, location and either task or error. The center point is admitted first, alone. If it is refused (for example 422 LOCATION_UNSUPPORTED, 403 KEY_SCOPE_DENIED, 402 INSUFFICIENT_CREDITS or a full plan), that error is the response for the whole grid and no task is created. Points after the center that are refused for capacity fail in place with success: false. Read a grid back with GET /v1/async/task/grid/{id}. Add ?include=response for finished tasks’ results. Points that were never admitted are absent, and another account’s grid id returns 404. Resending the same grid under the same id admits only the missing points; see Idempotency.

Next steps

Idempotency

How each endpoint treats a repeated key.

Credits and limits

Plan concurrency and pacing.