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

# 查询 Midjourney 任务

> 按公开任务 ID 读取状态并识别业务错误。

`GET /mj/task/{id}/fetch`

`id` 是当前用户与项目可访问的公开任务 ID。成功返回任务对象，含 `id`、`status`、`progress`、`imageUrl` 等；失败可能返回 HTTP 200 的 `code` / `description` 信封。

例如未找到为 `code=4`、`description=task_no_found`。任务成功不保证图片 URL 长期有效，视频字段不可当图片解析。接口读取保存的任务记录。模式前缀与提交动作见[Midjourney 指南](/zh/guides/midjourney.md)。

[Read in English](/en/api-reference/midjourney-task.md)


## OpenAPI

````yaml openapi/relay.json GET /mj/task/{id}/fetch
openapi: 3.0.3
info:
  title: API — Core inference API
  version: 0.5.0
  description: >-
    面向接入的精选规范，不是全部管理或供应商接口。 / Curated integration specification, not the entire
    management or provider API.
  license:
    name: AGPL-3.0-or-later
servers:
  - url: https://gateway.example.com
    description: >-
      Example only; replace with your gateway origin and optional path prefix,
      without /v1.
security:
  - BearerAuth: []
paths:
  /mj/task/{id}/fetch:
    get:
      summary: 查询 Midjourney 任务 / Retrieve a Midjourney task
      description: >-
        `id` 是当前用户与项目可访问的公开任务 ID。成功返回任务对象，含 `id`、`status`、`progress`、`imageUrl`
        等；失败可能返回 HTTP 200 的 `code` / `description` 信封。 / `id` is a public task
        ID accessible to the current user and project. Success returns a task
        object with `id`, `status`, `progress`, `imageUrl`, and extensions.
        Failure may use HTTP 200 with `code` / `description`.
      operationId: midjourney_task
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            读取业务字段，不只检查 HTTP 状态 / Validate business fields, not only HTTP
            status.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      id:
                        type: string
                      status:
                        type: string
                      progress:
                        type: string
                      imageUrl:
                        type: string
                      videoUrl:
                        type: string
                      videoUrls:
                        type: array
                        items:
                          type: object
                          properties:
                            url:
                              type: string
                          additionalProperties: true
                    additionalProperties: true
                    required:
                      - id
                      - status
                  - type: object
                    properties:
                      code:
                        type: integer
                      description:
                        type: string
                      result:
                        type: string
                    additionalProperties: true
                    required:
                      - code
                      - description
              example:
                id: mj_example
                status: IN_PROGRESS
                progress: 50%
        default:
          description: 错误格式与状态取决于入口 / Error status and shape depend on the entry.
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 模型调用 API Key，不是控制台登录凭据 / Model API key, not console login credentials

````

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