# 创建图像

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/images/generations:
    post:
      summary: 创建图像
      deprecated: false
      description: >+
        给定提示和/或输入图像，模型将生成新图像。

        本文档只展示出了一些常用的参数,如需进阶使用请参考官方文档

        相关指南：[官方图像生成文档](https://developers.openai.com/api/reference/resources/images/methods/generate)


        根据提示创建图像。

      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: 模型名称gpt-image系列
                size:
                  type: string
                  description: 生成图像的大小。512x512或 之一1024x1024, 1024x1792其他尺寸以官方文档为准。
                quality:
                  type: string
                  description: |-
                    auto(默认值）将自动为给定模型选择最佳质量。
                    high, medium, low GPT-Image模型支持。
                    hd and standard 支持dall-e-3。
                    standard支持dall-e-2。
                  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: gpt-image-2
              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: []

```
