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

# 查询任务

> 查询 Midjourney 任务状态/进度/结果图 URL。

请轮询至成功或失败。鉴权：Bearer。



## OpenAPI

````yaml zh-CN/openapi/xgapi-public.yaml GET /mj/task/{id}/fetch
openapi: 3.0.3
info:
  title: Omniall AI 公开 API
  description: >-
    Omniall AI 公开 API。网站：https://omniall.ai — API 主机：https://api.omniall.ai —
    模型广场：https://omniall.ai/pricing
  version: 1.1.0
servers:
  - url: https://api.omniall.ai
    description: 生产环境
security:
  - bearerAuth: []
tags:
  - name: Models
    description: 列出当前 API Key 可用的模型。
  - name: ChatGPT Chat Completions
    x-group: ChatGPT
    description: OpenAI Chat Completions 对话接口（`POST /v1/chat/completions`）。
  - name: Responses
    description: OpenAI Responses 接口（`POST /v1/responses`）。
  - name: Claude
    description: Anthropic Messages 消息接口（`POST /v1/messages`）。
  - name: Gemini
    description: Google Gemini 原生 generateContent / streamGenerateContent。
  - name: Images
    description: 图像生成（OpenAI Images）、各厂商说明与 Midjourney 代理接口。
  - name: Video
    description: 异步视频任务。
  - name: Audio
    description: 语音合成及相关音频接口。
  - name: Rerank
    description: 文档重排序。
paths:
  /mj/task/{id}/fetch:
    get:
      tags:
        - Images
      summary: 查询 Midjourney 任务
      description: |-
        查询 Midjourney 任务状态/进度/结果图 URL。

        请轮询至成功或失败。鉴权：Bearer。
      operationId: mjFetchTask
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: submit 接口返回的任务 ID。
      responses:
        '200':
          description: 任务快照
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  action:
                    type: string
                  status:
                    type: string
                    description: 如 NOT_START / SUBMITTED / IN_PROGRESS / SUCCESS / FAILURE
                  progress:
                    type: string
                    description: 进度文本，如 `100%`
                  imageUrl:
                    type: string
                  failReason:
                    type: string
                  buttons:
                    description: 后续放大/变体等按钮（含 customId）
        '400':
          description: 请求无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '429':
          description: 速率限制
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '500':
          description: 上游或网关错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
components:
  schemas:
    OpenAIErrorResponse:
      type: object
      description: 鉴权或请求失败时返回的 OpenAI 风格错误包络。
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              description: 人类可读错误信息。网关可能附加 request id 便于排查。
            type:
              type: string
              description: 错误类型，常见为 `new_api_error`。
              example: new_api_error
            code:
              type: string
              description: 可选机器可读错误码（如 `access_denied`），可能为空字符串。
          description: 错误对象。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: '使用来自 https://omniall.ai/dashboard 的 Authorization: Bearer sk-...'

````

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