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

# Generate Images

> 在给定提示的情况下创建图像。[了解更多](https://platform.openai.com/docs/guides/images)。



## OpenAPI

````yaml post /v1/images/generations/
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/generations/:
    post:
      tags:
        - Images / Native OpenAI Format
      summary: Generate Image
      description: >-
        Creates an image given a prompt. [Learn
        More](https://platform.openai.com/docs/guides/images).
      operationId: post-v1-images-generations
      parameters: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: >-
                    The model to use for image generation. Must be one of
                    `dall-e-2`, `dall-e-3`, or `gpt-image-1`. Defaults to
                    `dall-e-2` unless using parameters specific to
                    `gpt-image-1`.
                prompt:
                  type: string
                  description: >-
                    A text description of the desired image(s). The maximum
                    length is 32000 characters for `gpt-image-1`, 1000
                    characters for `dall-e-2`, and 4000 characters for
                    `dall-e-3`.
                'n':
                  type: integer
                  description: >-
                    The number of images to generate. Must be between 1 and 10.
                    For `dall-e-3`, only `n=1` is supported.
                size:
                  type: string
                  description: >-
                    The size of the generated images. For `gpt-image-1`, must be
                    one of `1024x1024`, `1536x1024` (landscape), `1024x1536`
                    (portrait), or `auto` (default). For `dall-e-2`, must be one
                    of `256x256`, `512x512`, or `1024x1024`. For `dall-e-3`,
                    must be one of `1024x1024`, `1792x1024`, or `1024x1792`.
                background:
                  type: string
                  description: >-
                    Allows setting transparency for the background of generated
                    images. This parameter only supports `gpt-image-1`. Must be
                    one of `transparent`, `opaque`, or `auto` (default). When
                    using `auto`, the model will automatically determine the
                    optimal background for the image.


                    If `transparent`, the output format needs to support
                    transparency, so it should be set to `png` (default) or
                    `webp`.
                moderation:
                  type: string
                  description: >-
                    Controls the content moderation level for images generated
                    by `gpt-image-1`. Must be `low` for less restrictive
                    filtering or `auto` (default).
                quality:
                  type: string
                  description: The quality of the generated image.
                stream:
                  type: string
                style:
                  type: string
                user:
                  type: string
              required:
                - prompt
              x-apifox-orders:
                - model
                - prompt
                - 'n'
                - size
                - background
                - moderation
                - quality
                - stream
                - style
                - user
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  created:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        b64_json:
                          type: string
                        url:
                          type: string
                      required:
                        - url
                      x-apifox-orders:
                        - b64_json
                        - url
                  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
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        Use Bearer Token authentication
        Format: Authorization: Bearer sk-xxxxxx

````