Create batch tasks
Submit up to 500 async tasks in a single request. Each task is validated independently, and results include per-task success or failure details.
Documentation Index
Fetch the complete documentation index at: https://docs.cloro.dev/llms.txt
Use this file to discover all available pages before exploring further.
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
resultsarray with success or failure details for each task, preserving the original input order byindex. - 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
429error.
taskType, payload, and optionally priority, idempotencyKey, and webhook.
Request constraints
| Constraint | Value |
|---|---|
| Minimum tasks per request | 1 |
| Maximum tasks per request | 500 |
| Queue capacity check | All-or-nothing. The batch is rejected if it would exceed your organization’s 100,000 task queue limit |
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:| Code | Description |
|---|---|
VALIDATION_ERROR | The task failed schema validation. details includes field-level errors. |
RESOURCE_ALREADY_EXISTS | The idempotencyKey was already used (either in a previous request or earlier in the same batch). |
INSUFFICIENT_CREDITS | Not enough credits remaining for this task. Credits are tracked per task within the batch. |
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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
1 - 500 elementsThe AI provider to use for this task.
AIMODE, GOOGLE, GOOGLE_NEWS, GEMINI, CHATGPT, COPILOT, PERPLEXITY, GROK "CHATGPT"
Provider-specific request payload. Must include at least prompt (or query for Google Search).
{
"prompt": "What do you know about Acme Corp?",
"country": "US"
}Task priority level (1-10). Higher numbers are processed first. Defaults to 1.
1 <= x <= 105
Unique string to prevent duplicate task creation. Must be unique across your account.
"batch-chatgpt-001"
Webhook configuration for task completion notification.
Response
Batch processed. Check the summary and individual results for per-task success or failure.