Pular para o conteúdo
OpenAI logo

GPT Image 1.5

Text-to-Image • OpenAI

Ver como Markdown
  • Third-party
  • Zero data retention

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

Model Info
Terms and License link
More information link
Zero data retentionYes
Pricing View pricing in the Cloudflare dashboard

Usage

const response = await env.AI.run(
  'openai/gpt-image-1.5',
  { prompt: 'A golden retriever puppy playing in autumn leaves' },
)
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-1.5",
  "input": {
    "prompt": "A golden retriever puppy playing in autumn leaves"
  }
}'
Simple Generation
{
  "gatewayMetadata": {
    "keySource": "BYOK"
  },
  "result": {
    "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__gpt-image-1.5/simple-generation.png"
  },
  "state": "Completed"
}

Examples

High Quality — Generate a high-quality detailed image
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',
  },
)
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-1.5",
  "input": {
    "prompt": "A detailed botanical illustration of exotic tropical flowers with fine line work and watercolor textures",
    "quality": "high"
  }
}'
High Quality
{
  "gatewayMetadata": {
    "keySource": "BYOK"
  },
  "result": {
    "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__gpt-image-1.5/high-quality.png"
  },
  "state": "Completed"
}
Low Quality Draft — Fast, rough draft for iteration
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',
  },
)
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-1.5",
  "input": {
    "prompt": "A quiet Japanese garden in morning mist with a stone lantern and koi pond",
    "quality": "low"
  }
}'
Low Quality Draft
{
  "gatewayMetadata": {
    "keySource": "BYOK"
  },
  "result": {
    "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__gpt-image-1.5/low-quality-draft.png"
  },
  "state": "Completed"
}
Medium Quality — Balanced quality for most uses
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',
  },
)
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-1.5",
  "input": {
    "prompt": "A neon-lit cyberpunk figure standing in the rain beneath a holographic billboard, cinematic lighting",
    "quality": "medium"
  }
}'
Medium Quality
{
  "gatewayMetadata": {
    "keySource": "BYOK"
  },
  "result": {
    "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__gpt-image-1.5/medium-quality.png"
  },
  "state": "Completed"
}
Auto Quality — Let the model pick an appropriate quality level
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',
  },
)
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-1.5",
  "input": {
    "prompt": "A panoramic view of the northern lights over a snowy mountain range, vivid greens and purples dancing across the sky",
    "quality": "auto"
  }
}'
Auto Quality
{
  "gatewayMetadata": {
    "keySource": "BYOK"
  },
  "result": {
    "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__gpt-image-1.5/auto-quality.png"
  },
  "state": "Completed"
}

Parameters

prompt
stringrequiredText prompt describing the image to generate or edit
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
image
stringformat: uriURL to the generated image

API Schemas (Raw)

Input
Output