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

# Create tasks in bulk

> Queue up to 500 tasks in one request, mixing engines freely.



## OpenAPI

````yaml POST /v1/async/task/batch
openapi: 3.1.0
info:
  title: querying.ai
  description: >-
    Cloro-compatible API for querying AI answer engines. Every task is
    asynchronous: submit, then collect the result via webhook or polling.
  version: 1.0.0
servers:
  - url: https://api.querying.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/async/task/batch:
    post:
      tags:
        - Tasks
      summary: Create tasks in bulk
      description: >-
        Queue up to 500 tasks in one request. Engines may be mixed freely.


        Always returns `200` for a well-formed request — per-task failures
        surface as `results[].success = false` so one bad task never sinks the
        rest. A duplicate `idempotencyKey` is absorbed as **success**, returning
        the existing task.
      operationId: createTaskBatch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              minItems: 1
              maxItems: 500
              items:
                $ref: '#/components/schemas/AsyncRequest'
            example:
              - taskType: GEMINI
                idempotencyKey: job-42:p1:gemini
                payload:
                  prompt: best wireless earbuds 2026
              - taskType: PERPLEXITY
                idempotencyKey: job-42:p1:perplexity
                payload:
                  prompt: best wireless earbuds 2026
              - taskType: GOOGLE
                idempotencyKey: job-42:p1:google
                payload:
                  query: best wireless earbuds 2026
      responses:
        '200':
          description: Batch processed. Inspect `results[]` for per-task outcomes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncBatchResult'
              example:
                success: true
                summary:
                  total: 3
                  succeeded: 2
                  failed: 1
                results:
                  - success: true
                    index: 0
                    task:
                      id: 8f2c1e40-0000-0000-0000-000000000000
                      taskType: GEMINI
                      status: QUEUED
                      priority: 1
                      createdAt: '2026-07-09T04:12:00.000Z'
                      idempotencyKey: job-42:p1:gemini
                    credits:
                      creditsToCharge: 0
                      creditsCharged: 0
                  - success: false
                    index: 1
                    error:
                      code: REGION_UNAVAILABLE
                      message: >-
                        cannot serve region 'DE': no live IPs provisioned. Check
                        GET /capacity.
                      timestamp: '2026-07-09T04:12:00.000Z'
                  - success: true
                    index: 2
                    task:
                      id: 1b7d9c22-0000-0000-0000-000000000000
                      taskType: GOOGLE
                      status: QUEUED
                      priority: 1
                      createdAt: '2026-07-09T04:12:00.000Z'
                      idempotencyKey: job-42:p1:google
                    credits:
                      creditsToCharge: 0
                      creditsCharged: 0
        '400':
          description: >-
            The request as a whole is malformed — not valid JSON, not an array,
            empty, or over 500 items.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: VALIDATION_ERROR
                  message: Request validation failed
                  details:
                    - field: ''
                      message: 'Too small: expected array to have >=1 items'
                  timestamp: '2026-07-09T04:12:00.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '413':
          description: Batch body exceeds 8 MB. Rejected before parsing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: PAYLOAD_TOO_LARGE
                  message: batch body exceeds 8388608 bytes
                  timestamp: '2026-07-09T04:12:00.000Z'
components:
  schemas:
    AsyncRequest:
      type: object
      required:
        - taskType
        - payload
      properties:
        taskType:
          $ref: '#/components/schemas/TaskType'
        idempotencyKey:
          type: string
          description: >-
            Optional. Deduplicates submissions. Omit for no deduplication. A
            duplicate is a `409` on this endpoint, but a success on the batch
            endpoint.
        priority:
          type: integer
          description: >-
            Queue ordering, higher wins. Values outside 1–10 are clamped, not
            rejected.
          minimum: 1
          maximum: 10
          default: 1
        webhook:
          type: object
          description: Optional. Omit to collect the result by polling instead.
          required:
            - url
          properties:
            url:
              type: string
              format: uri
              description: Receives a POST when the task reaches a terminal state.
        payload:
          $ref: '#/components/schemas/Payload'
      additionalProperties: false
    AsyncBatchResult:
      type: object
      required:
        - success
        - summary
        - results
      properties:
        success:
          type: boolean
        summary:
          type: object
          required:
            - total
            - succeeded
            - failed
          properties:
            total:
              type: integer
            succeeded:
              type: integer
            failed:
              type: integer
        results:
          type: array
          description: Positionally 1:1 with the submitted array, via `index`.
          items:
            type: object
            required:
              - success
              - index
            properties:
              success:
                type: boolean
              index:
                type: integer
                description: Index into the request array.
              task:
                $ref: '#/components/schemas/TaskMeta'
              credits:
                $ref: '#/components/schemas/Credits'
              error:
                $ref: '#/components/schemas/ErrorDetail'
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorDetail'
    TaskType:
      type: string
      description: The engine to query. `NAVER` is a deprecated alias for `NAVER_AI_BRIEF`.
      enum:
        - CHATGPT
        - PERPLEXITY
        - GEMINI
        - COPILOT
        - GROK
        - AIMODE
        - GOOGLE
        - CLAUDE
        - NAVER_AI_BRIEF
        - NAVER_AI_MODE
        - NAVER
        - DEEPSEEK
        - AMAZON
    Payload:
      type: object
      description: >-
        At least one of `prompt` or `query` is required. LLM engines read
        `prompt`; Google-family and Naver engines read `query`; Amazon prefers
        `prompt`.
      properties:
        prompt:
          type: string
          description: The question, for LLM engines.
        query:
          type: string
          description: The search term, for GOOGLE, AIMODE, and NAVER_* engines.
        country:
          type: string
          description: >-
            ISO 3166-1 alpha-2 region. Defaults to `US`. Gates submission on
            CHATGPT and CLAUDE.
          example: US
        newConversation:
          type: boolean
          description: >-
            ChatGPT anonymous mode only. Starts a thread; the result carries a
            `conversationId`. Omit both this and `conversationId` for
            single-shot.
        conversationId:
          type: string
          description: >-
            ChatGPT anonymous mode only. Continues a thread started with
            `newConversation`. Device-bound, expires after roughly two hours.
        include:
          $ref: '#/components/schemas/Include'
      additionalProperties: false
    TaskMeta:
      type: object
      required:
        - id
        - taskType
        - status
        - priority
        - createdAt
      properties:
        id:
          type: string
          format: uuid
        taskType:
          $ref: '#/components/schemas/TaskType'
        status:
          $ref: '#/components/schemas/TaskStatus'
        priority:
          type: integer
        createdAt:
          type: string
          format: date-time
        idempotencyKey:
          type: string
          description: >-
            Echoed back verbatim. **Omitted** — not null — when the caller
            supplied none.
    Credits:
      type: object
      description: >-
        Nominal only; nothing is billed. Always zero on submit and poll.
        Webhooks carry a per-engine figure mirroring Cloro's pricing.
      properties:
        creditsToCharge:
          type: integer
        creditsCharged:
          type:
            - integer
            - 'null'
    ErrorDetail:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable, safe to branch on.
          enum:
            - MISSING_API_KEY
            - VALIDATION_ERROR
            - REGION_UNAVAILABLE
            - RESOURCE_ALREADY_EXISTS
            - PAYLOAD_TOO_LARGE
            - RESOURCE_NOT_FOUND
            - ENQUEUE_ERROR
        message:
          type: string
          description: For humans. May change.
        details:
          description: >-
            Field-level context. An array of `{field, message}` on
            `VALIDATION_ERROR`; an object on `RESOURCE_NOT_FOUND` (`{id}`) and
            `REGION_UNAVAILABLE`. Omitted when there is nothing to add.
          oneOf:
            - type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
            - type: object
              additionalProperties: true
        timestamp:
          type: string
          format: date-time
    Include:
      type: object
      description: >-
        Optional output flags. **Most engines ignore these** and return a fixed
        shape — only ChatGPT's anonymous mode honours all six. See the engine
        guide for the support table.
      properties:
        markdown:
          type: boolean
          description: Honoured by CHATGPT-anon, PERPLEXITY, GEMINI, COPILOT, GROK.
        html:
          type: boolean
          description: Only ever produced by CHATGPT-anon.
        rawResponse:
          type: boolean
          description: Honoured by CHATGPT-anon, PERPLEXITY, GEMINI, COPILOT, GROK-anon.
        searchQueries:
          type: boolean
          description: >-
            Only gates output on CHATGPT-anon. Other engines that emit it do so
            unconditionally.
        ads:
          type: boolean
          description: Only honoured by CHATGPT-anon.
        shopping:
          type: boolean
          description: Only honoured by CHATGPT-anon.
      additionalProperties: false
    TaskStatus:
      type: string
      description: >-
        `PROCESSING` means a worker holds the task. `COMPLETED` and `FAILED` are
        terminal.
      enum:
        - QUEUED
        - PROCESSING
        - COMPLETED
        - FAILED
  responses:
    Unauthorized:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: MISSING_API_KEY
              message: Missing or invalid API key
              timestamp: '2026-07-09T04:12:00.000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as `Authorization: Bearer <key>`.'

````