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

# 编辑图片 · 条件可用

> 仅在模型明确支持 OpenAI-compatible 图片编辑协议时使用。普通文生图请使用 /v1/images/generations。



## OpenAPI

````yaml /relay.json post /v1/images/edits
openapi: 3.0.1
info:
  title: Tapapi 图片 API
  description: 一个 Key 跑全模型 · 当前公开主线为 OpenAI-compatible 文生图
  version: 1.0.0
servers: []
security:
  - BearerAuth: []
tags:
  - name: 获取模型列表
  - name: OpenAI格式(Chat)
  - name: OpenAI格式(Responses)
  - name: 图片生成
  - name: 图片生成/OpenAI兼容格式
  - name: 图片生成/Qwen千问
  - name: 视频生成
  - name: 视频生成/Sora兼容格式
  - name: 视频生成/Kling格式
  - name: 视频生成/即梦格式
  - name: Claude格式(Messages)
  - name: Gemini格式
  - name: OpenAI格式(Embeddings)
  - name: 文本补全(Completions)
  - name: OpenAI音频(Audio)
  - name: 重排序(Rerank)
  - name: Moderations
  - name: Realtime
  - name: 未实现
  - name: 未实现/Fine-tunes
  - name: 未实现/Files
paths:
  /v1/images/edits:
    post:
      tags:
        - 图片生成/OpenAI兼容格式
      summary: 编辑图片 · 条件可用
      description: 仅在模型明确支持 OpenAI-compatible 图片编辑协议时使用。普通文生图请使用 /v1/images/generations。
      operationId: createImageEdit
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: 模型名
                image:
                  type: string
                  format: binary
                  description: 输入图片文件
                mask:
                  type: string
                  format: binary
                  description: 可选 mask 文件
                prompt:
                  type: string
                  description: 编辑指令
                'n':
                  type: integer
                  default: 1
                  description: 生成张数
                size:
                  type: string
                  description: 图片尺寸
                response_format:
                  type: string
                  enum:
                    - url
                    - b64_json
                  default: url
              required:
                - model
                - image
                - prompt
      responses:
        '200':
          description: 成功编辑图片
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    ImageResponse:
      type: object
      properties:
        created:
          type: integer
        data:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
              b64_json:
                type: string
              revised_prompt:
                type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        使用 Bearer Token 认证。
        格式: `Authorization: Bearer sk-xxxxxx`

````