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

# Edit Image

> 在给定原始图像和提示的情况下创建编辑或扩展图像。





## OpenAPI

````yaml post /v1/images/edits/
openapi: 3.1.0
info:
  title: UToken API
  version: 1.0.0
  description: Complete UToken API Reference Documentation
servers:
  - url: https://utoken.yoostudio.ai
    description: Production
security: []
tags:
  - name: Images / Native Gemini Format
  - name: Images / Native OpenAI Format
  - name: Images / Qwen OpenAI Compatible Format
  - name: Realtime Voice
  - name: Content Moderation
  - name: Text Embeddings
  - name: Unimplemented / Fine-tuning
  - name: Unimplemented / File Management
  - name: Models / List Models
  - name: Chat Completions
  - name: Chat Completions / Native Gemini Format
  - name: Chat Completions / Native OpenAI Format
  - name: Text Completions
  - name: Video Generation
  - name: Video Generation / Sora Format
  - name: Video Generation / Jimeng (Dreamina) Format
  - name: Video Generation / Kling AI Format
  - name: Document Reranking
  - name: Audio Processing
  - name: Audio Processing / Native OpenAI Format
paths:
  /v1/images/edits/:
    post:
      tags:
        - Images / Native OpenAI Format
      summary: Edit Image
      description: >+
        Creates an edited or extended image given an original image and a
        prompt.

      operationId: post-v1-images-edits
      parameters: []
      requestBody:
        required: false
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                image:
                  description: >-
                    The image to edit. Must be a valid PNG file, less than 4MB,
                    and square. If mask is not provided, image must have
                    transparency, which will be used as mask.
                  type: string
                  format: binary
                  examples:
                    - >-
                      cmMtdXBsb2FkLTE2ODc4MzMzNDc3NTEtMjA=/31225951_59371037e9_small.png
                mask:
                  description: >-
                    An additional image whose fully transparent regions (e.g.,
                    where alpha is zero) indicate where image should be edited.
                    Must be a valid PNG file, less than 4MB, and with the same
                    dimensions as image.
                  type: string
                  format: binary
                  examples:
                    - []
                prompt:
                  description: >-
                    A text description of the desired image. The maximum length
                    is 1000 characters.
                  type: string
                  examples:
                    - A cute baby sea otter wearing a beret.
                'n':
                  description: The number of images to generate. Must be between 1 and 10.
                  type: string
                  examples:
                    - '1'
                size:
                  description: >-
                    The size of the generated images. Must be one of `256x256`,
                    `512x512`, or `1024x1024`.
                  type: string
                  examples:
                    - 1024x1024
                response_format:
                  description: >-
                    The format in which the generated images are returned. Must
                    be `url` or `b64_json`.
                  type: string
                  examples:
                    - url
                user:
                  description: >-
                    A unique identifier representing your end-user, which can
                    help monitor and detect abuse. [Learn
                    More](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids)。
                  type: string
                  examples:
                    - ''
                model:
                  type: string
                  examples:
                    - dall-e-2
              required:
                - image
                - prompt
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apifox-orders: []
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        Use Bearer Token authentication
        Format: Authorization: Bearer sk-xxxxxx

````