Skip to main content
POST

Authorizations

Authorization
string
header
required

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

Body

application/json

Request body of image generation.

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
prompt
string
required

Text description of the image, up to 32,000 characters.

n
integer<int64>

Number of images, 1–10, default 1.

size
string

Output size: auto (default) or WIDTHxHEIGHT. Both edges must be multiples of 16, the longest edge at most 3840, the long-to-short ratio at most 3:1, and the total pixels 655,360–8,294,400. E.g. 1024x1024, 1536x1024, 2048x1152, 3840x2160.

quality
enum<string>
default:auto

Rendering quality; higher is slower and uses more output tokens.

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 (%), default 100; jpeg / webp only.

moderation
enum<string>
default:auto

Content moderation level.

Allowed values:

  • auto: Standard moderation (default).
  • low: Less restrictive moderation.
Available options:
auto,
low
stream
boolean

Stream the result as SSE; default false.

partial_images
integer<int64>

Number of preview images pushed while streaming, 0–3, default 0. Each preview adds about 100 output tokens.

user
string

Deprecated; use safety_identifier. Used only when safety_identifier is empty.

safety_identifier
string

A stable end-user identifier for safety monitoring; hash the username or email. Up to 128 characters.

Response

Images generated. With stream: true the body is text/event-stream.

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.