Docs

DALL·E 3 Image Generation API Reference

Examples with dall-e-3 (DALL·E 3): text-to-image, edit, and variations.

FieldValue
Base URLhttps://token.easyapi.com/v1
AuthenticationAuthorization: Bearer `API_KEY`
Example modeldall-e-3
FormatOpenAI Images compatible
BillingPay as you go
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

POSThttps://token.easyapi.com/v1/images/generations

Generate images with DALL·E 3; returns 200 with URL or base64.

Request parameters

NameInTypeRequiredDescription
AuthorizationheaderstringYesEasyAPI API Key. Format: Bearer `API_KEY`
Content-TypeheaderstringYesRequest body format, always application/json

Request body

NameTypeRequiredDescription
modelstringYesImage model ID such as gpt-image-1, qwen-image-2.0-pro, or seedream-4.0; returns 400 model is required if missing
promptstringYesText prompt for the image; gpt-image-1 supports up to 32000 characters
nintegerNoNumber of images, 1–10, default 1; multiple images are billed per image
sizestringNoOutput size; gpt-image-1 supports 1024x1024, 1536x1024, 1024x1536, or auto, and it affects cost estimation
response_formatstringNourl or b64_json; gpt-image-1 does not support this field and upstream may reject it
streambooleanNoPassthrough 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

POSThttps://token.easyapi.com/v1/images/edits

Edit or extend a reference image via multipart/form-data; example model dall-e-3.

Request parameters

NameInTypeRequiredDescription
AuthorizationheaderstringYesEasyAPI API Key. Format: Bearer `API_KEY`
Content-TypeheaderstringYesmultipart/form-data

Request body

NameTypeRequiredDescription
imagefileYesPNG reference under 4MB; square works best
promptstringYesWhat to generate or change
modelstringNoModel ID, e.g. dall-e-3
nintegerNoNumber of images, default 1
sizestringNoOutput size within model limits

Example

# multipart/form-data 表单字段示例
image=@reference.png
prompt=将背景替换为星空夜景,保持狗狗主体不变
model=dall-e-3
size=1024x1024
Response: HTTP 200; same shape as text-to-image with url or b64_json in data.

Image variation

POSThttps://token.easyapi.com/v1/images/variations

Generate similar variations from a reference image; for DALL·E 3 and other OpenAI Images models.

Request parameters

NameInTypeRequiredDescription
AuthorizationheaderstringYesEasyAPI API Key. Format: Bearer `API_KEY`
Content-TypeheaderstringYesmultipart/form-data

Request body

NameTypeRequiredDescription
imagefileYesSquare PNG reference
nintegerNoNumber of variations, default 1
sizestringNo256x256, 512x512, or 1024x1024 depending on model
response_formatstringNourl or b64_json

Example

# multipart/form-data 表单字段示例
image=@reference.png
n=1
size=1024x1024
response_format=url

Response example

{
  "created": 1718452900,
  "data": [
    {
      "url": "https://cdn.example.com/images/img_dalle3_7c2f9a1b_var.png"
    }
  ]
}