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

# Get a unified AIHubMix task

> Returns a read-only task snapshot. Poll active media through the image or video detail endpoint instead.



## OpenAPI

````yaml /openapi.json get /ai/v1/tasks/{id}
openapi: 3.1.0
info:
  title: AIHubMix Gateway API
  description: |
    Unified multi-protocol gateway. Exposes three native shapes side-by-side:
      - OpenAI (`/v1/chat/completions`, `/v1/responses`, ...)
      - Anthropic (`/v1/messages`)
      - Gemini (`/v1beta/models/{model}:generateContent`)
    Each vendor's native SDK connects directly. Gateway-only fields are
    marked with `x-source.authority: gateway`.
  contact:
    name: AIHubMix Team
  version: 2.1.1
  x-upstream:
    vendorSpecs:
      packageVersion: 0.1.1
      installedFrom: npm
    sources:
      openai/official:
        version: '2026-05-31'
        hash: >-
          sha256:a203971a0bc0cd3b903b9488e3ac40eaa161a274dfaf172c1da73eee029147a8
      anthropic/official:
        version: '2026-05-31'
        hash: >-
          sha256:f9d488f9290d78a081bed62fa0c040476b5d009f3db92c06c8e279e69df73fc9
    layers:
      - role: L0-base
        source: avs://openai/official
        protocol: openai
        authority: official
      - role: L0-base
        source: avs://anthropic/official
        protocol: anthropic
        authority: official
      - role: gateway-other
        source: gateway/anthropic-mappings.yml
        protocol: all
        authority: gateway
      - role: horizontal-auth
        source: gateway/auth.yml
        protocol: all
        authority: gateway
      - role: horizontal-errors
        source: gateway/errors.yml
        protocol: all
        authority: gateway
      - role: L3-gateway
        source: gateway/openai-gateway.yml
        protocol: openai
        authority: gateway
      - role: gateway-other
        source: gateway/openai-image-mappings.yml
        protocol: all
        authority: gateway
      - role: gateway-other
        source: gateway/openai-mappings.yml
        protocol: all
        authority: gateway
      - role: L2-passthrough
        source: gateway/openai-passthrough.yml
        protocol: openai
        authority: gateway
servers:
  - url: https://aihubmix.com
    description: Production
  - url: https://api.inferera.com
    description: Backup (use when the primary domain is unreachable)
security:
  - gatewayBearer: []
tags:
  - name: OpenAI Compatible
    description: >-
      OpenAI-compatible endpoints (chat, completions, embeddings, images, audio,
      videos, moderations).
  - name: Anthropic Compatible
    description: Anthropic-native endpoints (messages with Anthropic protocol).
  - name: Google Vertex AI Compatible
    description: Google Gemini / Vertex AI endpoints.
  - name: AIHubMix Unified API
    description: AIHubMix native image, video, task, and model-discovery endpoints.
paths:
  /ai/v1/tasks/{id}:
    get:
      tags:
        - AIHubMix Unified API
      summary: Get a unified AIHubMix task
      description: >-
        Returns a read-only task snapshot. Poll active media through the image
        or video detail endpoint instead.
      operationId: getAIHubMixTask
      parameters:
        - $ref: '#/components/parameters/AIHubMixTaskId'
      responses:
        '200':
          description: Unified task snapshot
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIHubMixUnifiedTask'
        default:
          $ref: '#/components/responses/AIHubMixError'
components:
  parameters:
    AIHubMixTaskId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: AIHubMix task ID.
  schemas:
    AIHubMixUnifiedTask:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - llm
            - image
            - video
        model:
          type: string
        status:
          $ref: '#/components/schemas/AIHubMixTaskStatus'
        output:
          type: array
          items:
            $ref: '#/components/schemas/AIHubMixTaskArtifact'
        error:
          $ref: '#/components/schemas/AIHubMixTaskError'
        created_at:
          type: integer
          format: int64
        completed_at:
          type: integer
          format: int64
          nullable: true
        expires_at:
          type: integer
          format: int64
          nullable: true
      required:
        - id
        - object
        - model
        - status
        - output
        - error
        - created_at
        - completed_at
        - expires_at
    AIHubMixTaskStatus:
      type: string
      enum:
        - pending
        - in_progress
        - completed
        - failed
        - cancelled
      description: >-
        Current task state. Completed, failed, and cancelled are terminal
        states.
    AIHubMixTaskArtifact:
      type: object
      properties:
        index:
          type: integer
          minimum: 0
          description: Zero-based result order.
        result_id:
          type: string
          nullable: true
          description: >-
            Result ID exposed by unified task snapshots. Media task objects may
            omit it.
        type:
          type: string
          enum:
            - file
        content_type:
          type: string
          nullable: true
        content_url:
          type: string
          nullable: true
          description: Authenticated result download URL.
        b64_json:
          type: string
          nullable: true
          description: Base64-encoded image result when requested.
      required:
        - index
        - type
    AIHubMixTaskError:
      type: object
      nullable: true
      properties:
        code:
          type: string
          description: Stable task error code.
        message:
          type: string
          description: Human-readable error message.
        upstream_detail:
          description: Optional upstream diagnostic detail.
      required:
        - code
        - message
    GatewayError:
      type: object
      description: |
        OpenAI-compatible error envelope. Top-level `error` object carrying
        `message` / `type` / `param` / `code`. `request_id` lives in the
        `X-Request-Id` response header, not in the body. The legacy `upstream`
        field is no longer emitted.
      x-source:
        from: gateway
        authority: gateway
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            message:
              type: string
              description: Human-readable error message.
            type:
              type: string
              nullable: true
              description: >
                Error category. OpenAI-compatible values include

                invalid_request_error / authentication_error / permission_error
                /

                not_found_error / rate_limit_error, etc. The upstream value is

                passed through verbatim; the enum is not fixed.
            param:
              type: string
              nullable: true
              description: Name of the offending field, when applicable.
            code:
              nullable: true
              description: |
                Sub-error code. May be a string or integer (the gateway treats
                `code` as an arbitrary type).
  responses:
    AIHubMixError:
      description: >-
        AIHubMix task, validation, authentication, routing, artifact, or
        upstream error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GatewayError'
  securitySchemes:
    gatewayBearer:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        Gateway-issued API key, formatted as `sk-gateway-xxxxxxxx`.
        Used by OpenAI-shaped endpoints (/v1/chat/completions, etc.).
      x-source:
        from: gateway
        authority: gateway

````