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

# Edits 编辑

> MJ 编辑/局部重绘提交（需要时带 `maskBase64`）。

**Base：** `https://api.omniall.ai` + 路径。鉴权：`Authorization: Bearer sk-...`。任务为**异步**，请用 `GET /mj/task/{id}/fetch` 查询。



## OpenAPI

````yaml zh-CN/openapi/xgapi-public.yaml POST /mj/submit/edits
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/submit/edits:
    post:
      tags:
        - Images
      summary: Edits 编辑
      description: >-
        MJ 编辑/局部重绘提交（需要时带 `maskBase64`）。


        **Base：** `https://api.omniall.ai` + 路径。鉴权：`Authorization: Bearer
        sk-...`。任务为**异步**，请用 `GET /mj/task/{id}/fetch` 查询。
      operationId: mjEdits
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MidjourneyRequest'
            example:
              prompt: change coat to red
              taskId: xxxx
              maskBase64: ...
      responses:
        '200':
          description: 已接受提交（异步）。用返回的任务 ID 轮询 fetch。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MidjourneySubmitResponse'
        '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:
    MidjourneyRequest:
      type: object
      description: Midjourney 代理提交体（`/mj/submit/*`）。字段随动作（imagine/change/blend/…）而用。
      properties:
        prompt:
          type: string
          description: Imagine/Describe 的提示词文本。
          example: a red fox in misty forest --v 6
        base64Array:
          type: array
          items:
            type: string
          description: 参考图 Base64 数组（blend/edits/带参考的 imagine）。
        action:
          type: string
          description: change/simple-change/action 等接口的动作类型（如 UPSCALE、VARIATION）。
        index:
          type: integer
          description: 放大/变体按钮序号（通常 1–4）。
        taskId:
          type: string
          description: 继续任务时的 MJ 任务 ID（change/action/modal）。
        customId:
          type: string
          description: 上一任务 `buttons` 中的按钮 customId。
        notifyHook:
          type: string
          description: 可选任务完成回调 Webhook。
        state:
          type: string
          description: 客户端自定义状态，代理会回传。
        botType:
          type: string
          description: 部分 MJ 代理部署需要的 bot 类型。
        content:
          type: string
          description: 部分动作的附加内容（modal/shorten）。
        maskBase64:
          type: string
          description: 编辑/局部重绘蒙版 Base64。
    MidjourneySubmitResponse:
      type: object
      properties:
        code:
          type: integer
          description: 代理结果码（常见 `1` 表示已提交，以你的 MJ 代理约定为准）。
        description:
          type: string
          description: 可读状态说明。
        result:
          type: string
          description: 新任务 ID（用于 fetch）。
        properties:
          description: 代理返回的可选额外属性。
    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.