Skip to main content
POST
Create async task
Submits a task for asynchronous processing. The response carries a taskId you can poll via GET /v1/async/task/{taskId}; if you provide a webhook.url, cloro also delivers the results to that URL.
  • Priority: optional, 1 (lowest, default) to 10 (highest). The scheduler runs higher priority tasks first, then FIFO within the same level. Check your queue’s priority distribution with the async status endpoint.
  • Idempotency: an optional idempotencyKey prevents duplicate task creation. Reusing a key returns 409 Conflict.
New tasks start with status QUEUED. Submitting costs nothing on its own — credits are charged when the task completes. The balance is still checked at submission, so this endpoint returns 403 INSUFFICIENT_CREDITS when your credits do not cover the task’s creditsToCharge, and a queued task can still fail later if the balance runs out before the scheduler reaches it. See what happens when credits run out.

Example usage

Authorizations

Authorization
string
header
required

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

Body

application/json
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

Task created successfully. Returns task ID and initial status.

success
boolean
required
Example:

true

task
object
required

Common task summary fields shared across async task responses.

credits
object
required

Credit information for an async task.