ai-gateway
    ai-gateway
    • Suno
      • Suno Generate
        POST
      • Suno Feed
        GET
      • Suno Concat
        POST
      • Suno Generate (Extend)
        POST
    • Stable Diffusion
      • Stable Diffusion 文生图
        POST
      • Stable Diffusion 图生图
        POST
      • ReActor image
        POST
    • Create chat completion
      POST
    • Create chat completion with stream
      POST
    • Create image
      POST
    • Create speech
      POST
    • Create transcription
      POST
    • asr
      POST
    • asr Copy
      POST
    • Create transcription Copy
      POST

      Create image

      POST
      /v1/images/generations

      请求参数

      Authorization
      在 Header 添加参数
      Authorization
      ,其值为在 Bearer 之后拼接 Token
      示例:
      Authorization: Bearer ********************
      Body 参数application/json
      prompt
      string 
      必需
      A text description of the desired image(s). The maximum length is 1000 characters for dall-e-2 and 4000 characters for dall-e-3.
      model
      string 
      可选
      The model to use for image generation.
      默认值:
      dall-e-2
      n
      integer 
      可选
      The number of images to generate. Must be between 1 and 10. For dall-e-3, only n=1 is supported.
      默认值:
      1
      quality
      string 
      可选
      The quality of the image that will be generated. hd creates images with finer details and greater consistency across the image. This param is only supported for dall-e-3.
      默认值:
      standard
      response_format
      string 
      可选
      The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated.
      默认值:
      url
      size
      string 
      可选
      The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 for dall-e-2. Must be one of 1024x1024, 1792x1024, or 1024x1792 for dall-e-3 models.
      默认值:
      1024x1024
      style
      string 
      可选
      The style of the generated images. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for dall-e-3.
      默认值:
      vivid
      user
      string 
      可选
      A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
      示例
      {
          "prompt": "一条狗和一只猫在玩耍",
          "model": "dall-e-3"
      }

      示例代码

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      请求示例请求示例
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST 'https://api.aigateway.work/v1/images/generations' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "prompt": "一条狗和一只猫在玩耍",
          "model": "dall-e-3"
      }'

      返回响应

      🟢200成功
      application/json
      Body
      created
      integer 
      必需
      data
      array [object {3}] 
      必需
      b64_json
      string 
      可选
      The base64-encoded JSON of the generated image, if response_format is b64_json.
      url
      string 
      可选
      The URL of the generated image, if response_format is url (default).
      revised_prompt
      string 
      可选
      The prompt that was used to generate the image, if there was any revision to the prompt.
      示例
      {
          "created": 1708585321,
          "data": [
              {
                  "url": "https://filesystem.site/cdn/20240222/tLnwCLUpYbycUbXW8dX1LUmyMQhWh4.webp"
              }
          ]
      }
      修改于 2024-03-05 10:37:02
      上一页
      Create chat completion with stream
      下一页
      Create speech
      Built with