> ## Documentation Index
> Fetch the complete documentation index at: https://cloro.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use only the endpoint paths in https://cloro.dev/docs/skill.md. Do not derive a path from a docs page URL.
> For many requests, use the async API (POST /v1/async/task or POST /v1/async/task/batch). It has no sync surcharge.
> To call cloro as tools, use the MCP server at https://mcp.cloro.dev/mcp.
> Plan prices are at https://cloro.dev/pricing/. Credits for each request are at https://cloro.dev/docs/guides/providers.md.

# Create async task

> Submit an asynchronous task for background processing. Returns a task ID that you can use to poll for results or receive via webhook.

Submits a task for asynchronous processing. The response carries a `taskId` you can poll via [`GET /v1/async/task/{taskId}`](https://cloro.dev/docs/api-reference/endpoint/get-task-status); 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](https://cloro.dev/docs/guides/making-requests/async.md#request-prioritization) tasks first, then FIFO within the same level. Check your queue's priority distribution with the [async status endpoint](https://cloro.dev/docs/api-reference/endpoint/get-async-status.md).
* **Idempotency**: an optional `idempotencyKey` prevents duplicate task creation. Reusing a key returns `409 Conflict`, and `error.details.taskId` is the ID of the task that already holds the key.

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](https://cloro.dev/docs/guides/making-requests/async.md#what-happens-to-async-tasks-when-my-credits-run-out).

## Example usage

```bash cURL theme={null}
curl -X POST "https://api.cloro.dev/v1/async/task" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskType": "CHATGPT",
    "priority": 5,
    "idempotencyKey": "your-custom-identifier-123",
    "webhook": {
      "url": "https://your-app.com/webhook-handler"
    },
    "payload": {
      "prompt": "What is the weather in New York?",
      "country": "US"
    }
  }'
```

```json Response theme={null}
{
  "success": true,
  "task": {
    "id": "b27a21e1-7c39-4aa2-a347-23e828c426f9",
    "taskType": "CHATGPT",
    "status": "QUEUED",
    "priority": 5,
    "createdAt": "2025-11-10T15:00:00.000Z",
    "latencyMs": null,
    "idempotencyKey": "your-custom-identifier-123"
  },
  "credits": {
    "creditsToCharge": 5,
    "creditsCharged": null
  }
}
```

## Request fields

`POST https://api.cloro.dev/v1/async/task`

| Field | Type | Required | Description |
| - | - | - | - |
| `taskType` | `AIMODE`, `BING_AIMODE`, `BING`, `GOOGLE`, `GOOGLE_NEWS`, `GOOGLE_PRODUCT`, `GEMINI`, `CHATGPT` | Yes | The AI provider to use for this task. |
| `payload` | object | Yes | The provider's request body, validated against the same schema as its sync endpoint (for example `ChatGPTMonitorRequest`). That makes `country` required here too, or `gl` on the Google endpoints. For `GOOGLE_PRODUCT`, send only `productResultToken`. |
| `priority` | integer | No | Task priority level (1-10). Higher numbers are processed first. Defaults to 1. Default: `1`. |
| `idempotencyKey` | string | No | Unique string to prevent duplicate task creation. Must be unique across your account. |
| `webhook` | object | No | Webhook configuration for task completion notification. |
| `webhook.url` | string | With `webhook` | URL to receive the webhook POST request when the task completes. |

Full schema with every nested type (large): [openapi.json](https://cloro.dev/docs/api-reference/openapi.json)


## API Specification

The full API specification for this endpoint is available in the [documentation index](https://cloro.dev/docs/llms.txt).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.