> ## 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.

# Get a task

> Poll a task by id. Retained for 24 hours.



## OpenAPI

````yaml GET /v1/async/task/{id}
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/{id}:
    get:
      tags:
        - Tasks
      summary: Get a task
      description: >-
        Fetch a task by id. `response` is absent until the task reaches a
        terminal state. Tasks are retained for 24 hours, after which this
        returns `404`.
      operationId: getTask
      parameters:
        - name: id
          in: path
          required: true
          description: The task id returned at submit time.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The task, plus `response` or `error` once terminal.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
              examples:
                queued:
                  summary: Still queued — no response yet
                  value:
                    success: true
                    task:
                      id: 8f2c1e40-0000-0000-0000-000000000000
                      taskType: GEMINI
                      status: QUEUED
                      priority: 1
                      createdAt: '2026-07-09T04:12:00.000Z'
                    credits:
                      creditsToCharge: 0
                      creditsCharged: 0
                completed:
                  summary: Completed
                  value:
                    success: true
                    task:
                      id: 8f2c1e40-0000-0000-0000-000000000000
                      taskType: GEMINI
                      status: COMPLETED
                      priority: 1
                      createdAt: '2026-07-09T04:12:00.000Z'
                    credits:
                      creditsToCharge: 0
                      creditsCharged: 0
                    response:
                      text: The best wireless earbuds in 2026 are ...
                      sources:
                        - position: 1
                          url: https://example.com/review
                          label: Best earbuds, reviewed
                      timing:
                        totalMs: 7400
                failed:
                  summary: Failed — note `error` is a string here, not an object
                  value:
                    success: true
                    task:
                      id: 8f2c1e40-0000-0000-0000-000000000000
                      taskType: GEMINI
                      status: FAILED
                      priority: 1
                      createdAt: '2026-07-09T04:12:00.000Z'
                    credits:
                      creditsToCharge: 0
                      creditsCharged: 0
                    error: engine timeout after 3 attempts
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            Unknown task id, or the task aged out of the 24-hour retention
            window. The two cases are indistinguishable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: RESOURCE_NOT_FOUND
                  message: Task not found
                  details:
                    id: 8f2c1e40-0000-0000-0000-000000000000
                  timestamp: '2026-07-09T04:12:00.000Z'
components:
  schemas:
    TaskResponse:
      type: object
      required:
        - success
        - task
        - credits
      properties:
        success:
          type: boolean
          const: true
        task:
          $ref: '#/components/schemas/TaskMeta'
        credits:
          $ref: '#/components/schemas/Credits'
        response:
          type: object
          description: >-
            The engine-specific result. Absent until the task is terminal. See
            the Engines guide for per-engine shapes.
          additionalProperties: true
        error:
          type: string
          description: >-
            Present when `task.status` is `FAILED`. A plain string — not the
            `{code, message, timestamp}` object used by request-level errors.
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorDetail'
    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
    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
    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>`.'

````