- Third-party
OpenAI's most capable image generation and editing model. It accepts text and image inputs and produces images with low, medium, high, xhigh, max, and auto quality settings.
| Model Info | |
|---|---|
| Terms and License | link ↗ |
| More information | link ↗ |
| Pricing |
|
const response = await env.AI.run(
'openai/gpt-image-2.5-sunburst',
{
prompt:
'A cutaway editorial illustration of a floating ocean research station during a storm, showing laboratories, hydroponic gardens, autonomous submersibles, and illuminated underwater cables, precise technical details, dramatic but realistic lighting',
quality: 'max',
size: '1536x1024',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "openai/gpt-image-2.5-sunburst",
"input": {
"prompt": "A cutaway editorial illustration of a floating ocean research station during a storm, showing laboratories, hydroponic gardens, autonomous submersibles, and illuminated underwater cables, precise technical details, dramatic but realistic lighting",
"quality": "max",
"size": "1536x1024"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/openai/gpt-image-2.5-sunburst/technical-editorial-illustration.png"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}Portrait WebP — Generate a portrait composition in WebP format
const response = await env.AI.run(
'openai/gpt-image-2.5-sunburst',
{
prompt:
'A fashion portrait of an astronaut botanist in a glass greenhouse on Mars, crimson dust visible through the windows, translucent fabric, delicate blue flowers in the foreground, soft rim light, sophisticated magazine photography',
quality: 'xhigh',
size: '1024x1536',
output_format: 'webp',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "openai/gpt-image-2.5-sunburst",
"input": {
"prompt": "A fashion portrait of an astronaut botanist in a glass greenhouse on Mars, crimson dust visible through the windows, translucent fabric, delicate blue flowers in the foreground, soft rim light, sophisticated magazine photography",
"quality": "xhigh",
"size": "1024x1536",
"output_format": "webp"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/openai/gpt-image-2.5-sunburst/portrait-webp.webp"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}Cinematic Reference Edit — Edit a reference image into a cinematic scene while preserving its main subject
const response = await env.AI.run(
'openai/gpt-image-2.5-sunburst',
{
prompt:
"Turn the reference drawing into a polished cinematic stop-motion scene. Preserve the character's face and red scarf, add a miniature train platform at night, warm station lights, shallow depth of field, handcrafted felt and paper textures",
images: [
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAnklEQVR42u2XQRLAIAgD8/839i/26qFCACm0ozPe1KwcQsAoXvgcAABxpwFowl4QWITHxW0LCBhxVngF4gKIirMQyBRnIJAtrkE8AuwWnyFEgKzfS1UA+3sWTju3BGAu7gKYIfBW+Q/AAQgBeMCkt1wVsLZjcwUYG2Z9wGLHZitWk1DEisubUYt2XB5IWkSyFqG0RSxvMZi0Gc1+Ox3fm00ZJ5mGVtkAAAAASUVORK5CYII=',
],
quality: 'high',
background: 'opaque',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "openai/gpt-image-2.5-sunburst",
"input": {
"prompt": "Turn the reference drawing into a polished cinematic stop-motion scene. Preserve the character'\''s face and red scarf, add a miniature train platform at night, warm station lights, shallow depth of field, handcrafted felt and paper textures",
"images": [
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAnklEQVR42u2XQRLAIAgD8/839i/26qFCACm0ozPe1KwcQsAoXvgcAABxpwFowl4QWITHxW0LCBhxVngF4gKIirMQyBRnIJAtrkE8AuwWnyFEgKzfS1UA+3sWTju3BGAu7gKYIfBW+Q/AAQgBeMCkt1wVsLZjcwUYG2Z9wGLHZitWk1DEisubUYt2XB5IWkSyFqG0RSxvMZi0Gc1+Ox3fm00ZJ5mGVtkAAAAASUVORK5CYII="
],
"quality": "high",
"background": "opaque"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/openai/gpt-image-2.5-sunburst/cinematic-reference-edit.png"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}prompt
stringrequiredText prompt describing the image to generate or edit▶images[]
arraymaxItems: 16Input images for image editing, 1-16 entries. Each entry is base64-encoded (raw string or data:image/{png|jpeg|webp};base64,... URI).quality
stringenum: low, medium, high, xhigh, max, autoQuality of the generated imagesize
stringenum: 1024x1024, 1024x1536, 1536x1024, autoSize of the generated imagebackground
stringenum: transparent, opaque, autoBackground transparency settingoutput_format
stringenum: png, webp, jpegOutput format for the generated imageimage
stringformat: uriURL to the generated image