Skip to main content
POST

Authorizations

x-key
string
header
required

Body

application/json
prompt
string
required

Free-form prompt describing the image.

user
string | null

Opaque identifier for the end user supplied by the calling platform.

Required string length: 1 - 256
Pattern: ^[^\x00]*$
images

Optional reference image(s) the prompt edits or draws from; each is an http(s) URL or base64, one to 10 total.

aspect_ratio
default:auto

Output aspect ratio. Under auto a ratio the prompt asks for wins, otherwise the output keeps the first reference image's framing; without references the prompt decides, else 1:1.

Available options:
21:9,
2:1,
16:9,
3:2,
7:5,
4:3,
5:4,
1:1,
4:5,
3:4,
5:7,
2:3,
9:16,
1:2,
9:21
resolution
enum<string>
default:1k

Image resolution class, an equal-pixel-area tier: 768sq, 1k (default), 1.5k, 2k, or 4k. Exact dimensions vary with the aspect ratio. match_input (edits only): the output keeps the first reference's own size (shrunk to 4 MP when larger), or its nearest tier when aspect_ratio is set. Ignored when width and height are set.

Available options:
768sq,
1k,
1.5k,
2k,
4k,
match_input
width
integer | null

Exact output width in pixels, [256, 6256]; set together with height. Overrides resolution and aspect_ratio.

height
integer | null

Exact output height in pixels, [256, 6256]; width x height at most 16822272 pixels, and at most 4194304 with reference images.

safety_tolerance
integer
default:2

Harm moderation tolerance from 0 to 7, with 0 the strictest. The route and organization determine the approved maximum and per-category ceilings. Unapproved levels return 422 with approved levels.

Required range: 0 <= x <= 7
grounding
boolean
default:true

When true (default) the prompt may be grounded in external research: web search and image search. When false, both are off.

version
string
default:latest

Endpoint version. latest (default) serves the current release; dated pinnable release tags are added here as they are published.

Allowed value: "latest"

Response

Successful Response

id
string
required
polling_url
string
required
cost
number | null

Cost in credits for this request

input_mp
number | null

Input megapixels (2 decimal places)

output_mp
number | null

Output megapixels (2 decimal places)