Skip to main content
POST
Create batch async tasks

Overview

The batch endpoint lets you submit multiple async tasks in a single HTTP request, reducing overhead for high-volume workloads. Instead of making one API call per task, you can send up to 500 tasks at once. Key behaviors:
  • Partial success: Each task is validated independently. One invalid task does not block others from being created.
  • Per-task results: The response includes a results array with success or failure details for each task, preserving the original input order by index.
  • All-or-nothing queue check: Before processing individual tasks, the endpoint verifies that your queue has enough capacity for the entire batch. If it doesn’t, the whole batch is rejected with a 429 error.
  • Per-task webhook delivery: each task fires its own webhook notification as soon as it completes — you don’t wait for the full batch to finish. Webhooks arrive in completion order, not submission order.
Each task in the batch accepts the same fields as a single async task: taskType, payload, and optionally priority, idempotencyKey, and webhook.
For submitting a single task, see the async requests guide.

Request constraints

If the request body is not a valid JSON array or is empty, the endpoint returns a 422 Unprocessable Entity error before any task-level processing begins.

Per-task error codes

When a task fails validation within a batch, its result includes one of these error codes:
The queue capacity check is all-or-nothing. If the batch would exceed your queue limit, every task in the batch is rejected. Per-task validation errors only affect the individual task.

Example usage

Submit a batch of tasks

Response with partial success

When some tasks succeed and others fail, the response includes results for every task:

Use cases

Bulk monitoring across providers

Submit tasks to multiple AI providers simultaneously to compare responses:

Scheduled batch jobs

Process a list of queries in one request instead of submitting them one at a time:

Handling partial failures

Check results and retry only the failed tasks:

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
Required array length: 1 - 500 elements
taskType
enum<string>
required

The AI provider to use for this task.

Available options:
AIMODE,
GOOGLE,
GOOGLE_NEWS,
GEMINI,
CHATGPT,
COPILOT,
PERPLEXITY,
GROK
Example:

"CHATGPT"

payload
object
required

Provider-specific request payload. Must include at least prompt (or query for Google Search).

Example:
priority
integer
default:1

Task priority level (1-10). Higher numbers are processed first. Defaults to 1.

Required range: 1 <= x <= 10
Example:

5

idempotencyKey
string

Unique string to prevent duplicate task creation. Must be unique across your account.

Example:

"batch-chatgpt-001"

webhook
object

Webhook configuration for task completion notification.

Response

Batch processed. Check the summary and individual results for per-task success or failure.

success
boolean
required

Always true for a successfully processed batch (individual tasks may still fail).

Example:

true

summary
object
required

Aggregate counts for the batch.

results
object[]
required

Per-task results preserving the original input order by index.