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

# 图像描述

> 上传一张图，得到可以直接用来生成的提示词描述。

> [!TIP]
>
> 也可以用统一任务接口 `POST /v1/task/submit` 提交：`model` 填 `midjourney-describe`，参数放进 `input`。两种写法效果与计费完全一样。

识图是同步的：响应里直接就是结果（`status` 为 `success`，描述在 `descriptions` 里），不用再查询。


## OpenAPI

````yaml cn/openapi/midjourney.json POST /midjourney/describe
openapi: 3.1.0
info:
  title: Midjourney API
  version: 1.0.0
  description: Midjourney 接口
servers:
  - url: https://api.ephone.ai
security:
  - bearerAuth: []
paths:
  /midjourney/describe:
    post:
      summary: 图像描述
      description: 上传一张图，得到可以直接用来生成的提示词描述。
      operationId: midjourney_describe
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                image:
                  type: string
                  description: '**图片**：图片 URL（公网可访问）或 base64 data URI，单张不超过 20 MB。'
                notify_hook:
                  type: string
                  format: uri
                  description: >-
                    **推送地址**：任务结束后，把和查询结果相同的内容 POST 到这个地址（公网可以访问的 http / https
                    地址）。不传就自己查询。
              required:
                - image
            example:
              image: https://example.com/cat.png
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
              example:
                task_id: mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3
                action: describe
                status: success
                descriptions:
                  - 一只橘猫趴在窗台上晒太阳……
                created_at: 1792000000
                finished_at: 1792000000
        '400':
          description: invalid_request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: invalid_request
                  message: index must be between 1 and 4
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Invalid API key
        '402':
          description: insufficient_quota
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient balance
        '429':
          description: queue_full
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: queue_full
                  message: Queue is full, please try again later
        '500':
          description: upstream_error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: upstream_error
                  message: The service is temporarily unavailable, please retry
components:
  schemas:
    Task:
      type: object
      properties:
        task_id:
          type: string
          description: 任务 ID。
        action:
          type: string
          description: 动作名，例如 `imagine`、`upscale`。
        status:
          type: string
          description: 任务状态，取值见上表。
          enum:
            - submitted
            - in_progress
            - success
            - failure
        speed:
          type: string
          description: 提交时选的速度档：`relax`、`fast` 或 `turbo`，也是计费的那一档。识图不分速度，没有这一项。
        prompt:
          type: string
          description: 实际提交的提示词。
        images:
          type: array
          items:
            type: string
          description: '图片地址，顺序就是图片序号（第 1 张对应 `index: 1`）。未通过内容审核的位置是空字符串。'
        videos:
          type: array
          items:
            type: string
          description: 视频地址（视频接口），顺序就是视频序号。
        descriptions:
          type: array
          items:
            type: string
          description: 识图结果（describe 接口）。
        seed:
          type: integer
          description: 种子值。
        actions:
          type: array
          items:
            type: string
          description: >-
            这个任务还能接着做的加工，例如 `["upscale", "variation", "reroll"]`。调 `POST
            /midjourney/action` 时填进 `action`，再传 `task_id`；按图操作的还要传
            `index`，`reroll` 不用。
        fail_reason:
          type: string
          description: 失败原因。
        created_at:
          type: integer
          description: 创建时间（Unix 秒）。
        finished_at:
          type: integer
          description: 结束时间（Unix 秒）。
        usage:
          type: object
          description: >-
            用量，只在 `success` 时返回，例如 `{"type": "call", "multiplier":
            2}`。`multiplier` 是规格倍率，相对于价格表里所选速度档的单价：高清为 2，V7 草图为
            0.5，视频按分辨率和数量计；不含账户折扣。实际扣了多少钱看响应头 `X-Billing-Amount`（查询时带
            `X-Billing-Detail: true`）。
      required:
        - task_id
        - action
        - status
        - created_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: '在请求头 `Authorization: Bearer YOUR_API_KEY` 里带上 API Key。'

````

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