Skip to main content
POST

Authorizations

x-key
string
header
required

Body

application/json
prompt
string
required

Free-form prompt describing the image.

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, 1.5k, 2k, or 4k. Exact dimensions vary with the aspect ratio.

Available options:
768sq,
1k,
1.5k,
2k,
4k
safety_tolerance
integer
default:2

Tolerance level for input and output harm moderation. Between 0 and 4, with 0 the strictest.

Required range: 0 <= x <= 4
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)