Skip to main content
POST
Edit image

Authorizations

Authorization
string
header
required

API Key created in the DreamTo console, sent as Authorization: Bearer <API Key>.

Body

multipart/form-data

multipart/form-data form of image editing.

image[]
file[]
required

Input image files (png / jpeg / webp, each under 50 MB); repeat the field for several images, up to 16.

prompt
string
required

Description of the edit, up to 32,000 characters.

model
enum<string>
required

Model name.

Allowed values:

  • gpt-image-2.5-sunburst-economy: GPT Image 2.5 Sunburst, for workflows where editing precision matters most.
  • gpt-image-2.5-flare-economy: GPT Image 2.5 Flare, for fast, high-quality everyday generation.
Available options:
gpt-image-2.5-sunburst-economy,
gpt-image-2.5-flare-economy
mask
file

Optional mask PNG: transparent pixels mark the area to change; must match the first input image's size.

n
integer<int64>

Number of images, 1–10, default 1.

size
string

Output size, same rules as size of image generation; default auto.

quality
enum<string>
default:auto

Rendering quality.

Allowed values:

  • auto: Chosen by the model (default).
  • low: Low: fastest and cheapest, good for drafts.
  • medium: Medium.
  • high: High: best detail and text, slowest.
  • xhigh: Extra high: finer texture and small text, with more latency and output tokens.
  • max: Maximum: the slowest and most output tokens; OpenAI recommends it only when lower tiers miss a quality requirement.
Available options:
auto,
low,
medium,
high,
xhigh,
max
background
enum<string>
default:auto

Background type.

Allowed values:

  • auto: Decided by the model (default).
  • transparent: Transparent; needs png or webp output (a preview feature upstream).
  • opaque: Opaque.
Available options:
auto,
transparent,
opaque
output_format
enum<string>
default:png

Output image format.

Allowed values:

  • png: PNG (default).
  • jpeg: JPEG: smaller and faster.
  • webp: WebP.
Available options:
png,
jpeg,
webp
output_compression
integer<int64>

Compression level 0–100 (%); jpeg / webp only.

stream
boolean

Stream the result as SSE; default false.

partial_images
integer<int64>

Number of preview images pushed while streaming, 0–3.

user
string

End-user identifier for safety monitoring.

Response

Images edited.

Generation result.

created
integer<int64>
required

Creation time, Unix seconds.

data
object[]
required

Generated images.

background
enum<string>

Background actually used.

Allowed values:

  • transparent: Transparent.
  • opaque: Opaque.
Available options:
transparent,
opaque
output_format
enum<string>
default:png

Actual output format.

Allowed values:

  • png: PNG (default).
  • jpeg: JPEG: smaller and faster.
  • webp: WebP.
Available options:
png,
jpeg,
webp
quality
enum<string>

Actual rendering quality.

Allowed values:

  • low: Low.
  • medium: Medium.
  • high: High.
  • xhigh: Extra high.
  • max: Maximum.
Available options:
low,
medium,
high,
xhigh,
max
size
string

Actual output size, e.g. 1024x1024.

usage
object

Token usage.