# 图像编辑

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/images/edits:
    post:
      summary: 图像编辑
      deprecated: false
      description: |-
        在给定原始图像和提示的情况下创建编辑图像。
        本文档只展示出了一些常用的参数,如需进阶使用请参考官方文档
        https://platform.openai.com/docs/api-reference/images/createEdit
      tags:
        - 模型接口/图像接口（Images）
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: false
          example: Bearer {{YOUR_API_KEY}}
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: false
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                image:
                  format: binary
                  type: string
                  description: 每张图片应为png、webp或jpg大小不超过 25MB 的文件。您最多可以提供 16 张图片
                  example: ''
                prompt:
                  description: 所需图像的文本描述。最大长度为32000个字符。
                  example: ''
                  type: string
                model:
                  description: |
                    用于图像生成的模型。目前仅支持gpt-image-1。
                  example: gpt-image-1
                  type: string
                size:
                  description: 必须是1024x1024、1536x1024（横向）、1024x1536之一默认为1024x1024
                  example: 1024x1024
                  type: string
              required:
                - image
                - prompt
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  created:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        b64_json:
                          type: string
                      x-apifox-orders:
                        - b64_json
                      required:
                        - b64_json
                  usage:
                    type: object
                    properties:
                      total_tokens:
                        type: integer
                      input_tokens:
                        type: integer
                      output_tokens:
                        type: integer
                      input_tokens_details:
                        type: object
                        properties:
                          text_tokens:
                            type: integer
                          image_tokens:
                            type: integer
                        required:
                          - text_tokens
                          - image_tokens
                        x-apifox-orders:
                          - text_tokens
                          - image_tokens
                    required:
                      - total_tokens
                      - input_tokens
                      - output_tokens
                      - input_tokens_details
                    x-apifox-orders:
                      - total_tokens
                      - input_tokens
                      - output_tokens
                      - input_tokens_details
                required:
                  - created
                  - data
                  - usage
                x-apifox-orders:
                  - created
                  - data
                  - usage
              example:
                created: 1713833628
                data:
                  - b64_json: ...
                usage:
                  total_tokens: 100
                  input_tokens: 50
                  output_tokens: 50
                  input_tokens_details:
                    text_tokens: 10
                    image_tokens: 40
          headers: {}
          x-apifox-name: 成功
      security: []
      x-apifox-folder: 模型接口/图像接口（Images）
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/2946232/apis/api-230941694-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.chatanywhere.tech
    description: 正式环境
security: []

```
