API reference
🇺🇸 English
  • 🇨🇳 Chinese
  • 🇺🇸 English
  1. Image generation
API reference
🇺🇸 English
  • 🇨🇳 Chinese
  • 🇺🇸 English
  • Chat Models
    • Chat
      • Create chat completion
      • vision
    • OpenAI-Realtime
    • Completions
      • Instruct
    • Audio
      • Transcriptions
      • Translations
      • Speech
    • Image generation
      • DALL·E 3
        POST
    • Embeddings
      • Create
    • Models
      • model list
    • Help
      • 常见问题及解决办法
  • Anthropic
    • Anthropic Claude
      POST
  • Suno
    • Generate music
      POST
    • Generate lyrics
      POST
    • Upload music
      POST
    • Music concat
      POST
    • Fetch task
      GET
    • Fetch batch tasks
      POST
  • Udio
    • Generate music
      POST
    • Fetch task
      GET
  • Midjourney API
    • Quick
    • Task Submit
      • Imagine
      • Action
      • Modal
      • Blend
      • Describe
      • Shorten
      • Upload discord
    • Get Task
      • Fetch task by ids
      • Fetch task by id
      • Get seed
  • Flux
    • Official
      • Generate
      • Finetune
      • Fetch task
    • OpenAI Dalle3
      POST
  • Recraft
    • Official
      • Generate Image
      • Vectorize Image
      • Remove Background
      • Clarity Upscale
      • Generative Upscale
      • Create style
    • OpenAI Dalle3
  • Ideogram
    • Generate
    • Remix
    • Edit
    • Upscale
    • Describe
  • Luma
    • Official
      • Generate
      • Fetch task
    • Own format
      • Submit
        • Generate
        • Get video of no mark
        • 扩展视频
      • Get task
        • Get task
        • Get batch task
  • Runway
    • Official
      • image to video
      • get task
    • reverse
      • text to video
      • image to video
      • video2video
      • Act-one
      • Get task
  • Kling-API
    • Callback
    • Generate image
    • Text 2 Video
    • Image 2 Video
    • Video extend
    • Get task
    • lip-sync
    • kolors-virtual-try-on
  • Replicate
    • Generate
    • Get
  • MiniMax
    • Generate video
    • Get task
    • Get file
  1. Image generation

DALL·E 3

POST
/v1/images/generations
Last modified:2025-02-05 11:14:30

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Header Params
Authorization
string 
optional
Example:
Bearer {{YOUR_API_KEY}}
Body Params application/json
prompt
string 
required
所需图像的文本描述。最大长度为 1000 个字符。
n
integer 
optional
要生成的图像数。必须介于 1 和 10 之间。
size
string 
optional
生成图像的大小。必须是256x256、512x512或 1024x1024之一。
Example
{
  "prompt": "A colorful sunset over the mountains",
  "n": 1,
  "model": "dall-e-3",
  "size": "1024x1024"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST '/v1/images/generations' \
--header 'Authorization: Bearer ' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
  "prompt": "A colorful sunset over the mountains",
  "n": 1,
  "model": "dall-e-3",
  "size": "1024x1024"
}'

Responses

🟢200Create image
application/json
Body
created
integer 
required
data
array [object {1}] 
required
url
string 
required
Example
{
  "created": 1589478378,
  "data": [
    {
      "url": "https://..."
    },
    {
      "url": "https://..."
    }
  ]
}
Previous
Speech
Next
Create
Built with