# 创建图像

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/images/generations:
    post:
      summary: 创建图像
      deprecated: false
      description: |+
        [图片](https://platform.openai.com/docs/api-reference/images)

        给定提示和/或输入图像，模型将生成新图像。

        相关指南：[图像生成](https://platform.openai.com/docs/guides/images)

        根据提示创建图像。

      tags:
        - 模型接口/图像接口（Images）
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: true
          example: Bearer {{YOUR_API_KEY}}
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: 所需图像的文本描述。最大长度为 1000 个字符。
                'n':
                  type: integer
                  description: 要生成的图像数。必须介于 1 和 10 之间。
                model:
                  type: string
                  description: 模型名称dall-e-3,dall-e-2,gpt-image-1
                size:
                  type: string
                  description: 生成图像的大小。必须是256x256、512x512或 之一1024x1024, 1024x1792。
                quality:
                  type: string
                  description: 如果过调用hd 此处填hd
                  examples:
                    - hd
              required:
                - prompt
                - 'n'
                - model
                - size
              x-apifox-orders:
                - prompt
                - 'n'
                - size
                - model
                - quality
            example:
              prompt: A colorful sunset over the mountains
              'n': 1
              model: dall-e-3
              size: 1024x1024
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  created:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                      required:
                        - url
                      x-apifox-orders:
                        - url
                required:
                  - created
                  - data
                x-apifox-orders:
                  - created
                  - data
              example:
                created: 1589478378
                data:
                  - url: https://...
                  - url: https://...
          headers: {}
          x-apifox-name: Create image
      security: []
      x-apifox-folder: 模型接口/图像接口（Images）
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/2946232/apis/api-92222078-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.chatanywhere.tech
    description: 正式环境
security: []

```
