DALL·E 3 Image Generation API Reference
Examples with dall-e-3 (DALL·E 3): text-to-image, edit, and variations.
Note: DALL·E 3 is synchronous; response includes image URL or base64. For async models like Midjourney, check Drawing Logs in the console.
Example model
Examples below use dall-e-3 (DALL·E 3). Replace model and adjust size, quality, etc. per console docs when switching models.
Text to image
POST
https://token.easyapi.com/v1/images/generationsGenerate images with DALL·E 3; returns 200 with URL or base64.
Request parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Authorization | header | string | Yes | EasyAPI API Key. Format: Bearer `API_KEY` |
Content-Type | header | string | Yes | Request body format, always application/json |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Image model ID such as gpt-image-1, qwen-image-2.0-pro, or seedream-4.0; returns 400 model is required if missing |
prompt | string | Yes | Text prompt for the image; gpt-image-1 supports up to 32000 characters |
n | integer | No | Number of images, 1–10, default 1; multiple images are billed per image |
size | string | No | Output size; gpt-image-1 supports 1024x1024, 1536x1024, 1024x1536, or auto, and it affects cost estimation |
response_format | string | No | url or b64_json; gpt-image-1 does not support this field and upstream may reject it |
stream | boolean | No | Passthrough field; image generation is synchronous and does not branch on this value |
Example
{
"model": "dall-e-3",
"prompt": "一只金毛犬在阳光明媚的海滩上奔跑,水彩插画风格,柔和光线",
"n": 1,
"size": "1024x1024"
}Response example
{
"created": 1718452800,
"data": [
{
"url": "https://cdn.example.com/images/img_dalle3_7c2f9a1b.png",
"revised_prompt": "A golden retriever running on a sunny beach, watercolor illustration style"
}
],
"usage": {
"total_tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"input_tokens_details": {
"text_tokens": 0,
"image_tokens": 0
}
}
}Image edit
POST
https://token.easyapi.com/v1/images/editsEdit or extend a reference image via multipart/form-data; example model dall-e-3.
Request parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Authorization | header | string | Yes | EasyAPI API Key. Format: Bearer `API_KEY` |
Content-Type | header | string | Yes | multipart/form-data |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
image | file | Yes | PNG reference under 4MB; square works best |
prompt | string | Yes | What to generate or change |
model | string | No | Model ID, e.g. dall-e-3 |
n | integer | No | Number of images, default 1 |
size | string | No | Output size within model limits |
Example
# multipart/form-data 表单字段示例
image=@reference.png
prompt=将背景替换为星空夜景,保持狗狗主体不变
model=dall-e-3
size=1024x1024Response: HTTP 200; same shape as text-to-image with url or b64_json in data.
Image variation
POST
https://token.easyapi.com/v1/images/variationsGenerate similar variations from a reference image; for DALL·E 3 and other OpenAI Images models.
Request parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Authorization | header | string | Yes | EasyAPI API Key. Format: Bearer `API_KEY` |
Content-Type | header | string | Yes | multipart/form-data |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
image | file | Yes | Square PNG reference |
n | integer | No | Number of variations, default 1 |
size | string | No | 256x256, 512x512, or 1024x1024 depending on model |
response_format | string | No | url or b64_json |
Example
# multipart/form-data 表单字段示例
image=@reference.png
n=1
size=1024x1024
response_format=urlResponse example
{
"created": 1718452900,
"data": [
{
"url": "https://cdn.example.com/images/img_dalle3_7c2f9a1b_var.png"
}
]
}