Skip to content
OpenAI logo

gpt-image-1.5

Text-to-ImageOpenAIProxied

OpenAI's image generation model that creates and edits images from text prompts, supporting multiple quality levels and output sizes.

Model Info
Terms and Licenselink
More informationlink
PricingView pricing in the Cloudflare dashboard

Usage

TypeScript
const response = await env.AI.run(
'openai/gpt-image-1.5',
{
prompt: 'A golden retriever puppy playing in autumn leaves',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Simple Generation

Examples

High Quality — Generate a high-quality detailed image
TypeScript
const response = await env.AI.run(
'openai/gpt-image-1.5',
{
prompt:
'A detailed botanical illustration of exotic tropical flowers with fine line work and watercolor textures',
quality: 'high',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
High Quality
Low Quality Draft — Fast, rough draft for iteration
TypeScript
const response = await env.AI.run(
'openai/gpt-image-1.5',
{
prompt:
'A quiet Japanese garden in morning mist with a stone lantern and koi pond',
quality: 'low',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Low Quality Draft
Medium Quality — Balanced quality for most uses
TypeScript
const response = await env.AI.run(
'openai/gpt-image-1.5',
{
prompt:
'A neon-lit cyberpunk figure standing in the rain beneath a holographic billboard, cinematic lighting',
quality: 'medium',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Medium Quality
Auto Quality — Let the model pick an appropriate quality level
TypeScript
const response = await env.AI.run(
'openai/gpt-image-1.5',
{
prompt:
'A panoramic view of the northern lights over a snowy mountain range, vivid greens and purples dancing across the sky',
quality: 'auto',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Auto Quality

Parameters

prompt
stringrequiredText prompt describing the image to generate or edit
image
stringBase64-encoded input image for image editing
quality
stringenum: low, medium, high, autoQuality of the generated image
size
stringenum: 256x256, 512x512, 1024x1024, 1792x1024, 1024x1792Size of the generated image
style
stringenum: vivid, naturalStyle of the generated image

API Schemas (Raw)

Input
Output