GPT Image 2 API

Model-specific Buble API parameters, modes, pricing, and examples for GPT Image 2.

GPT Image 2 API

GPT Image 2 is suited for high-instruction-following image generation and image editing workflows with larger prompt budgets.

Model keys

  • openai/gpt-image-2 — GPT Image 2

Supported modes and inputs

ModelModeLabelInput requirements
openai/gpt-image-2text_to_imageText to ImagePrompt max 20000 chars
openai/gpt-image-2image_to_imageImage to ImagePrompt max 20000 chars
Images reference: 1-16 files, 10 MB, formats jpg, png, webp

Options

ModelOptionDefaultAllowed valuesApplies to
openai/gpt-image-2resolution1K1K, 2K, 4KAll modes
openai/gpt-image-2aspect_ratio16:9auto, 1:1, 16:9, 9:16, 4:3, 3:4All modes

Pricing

ModelPricing
openai/gpt-image-21 credit per image; option multipliers: resolution={"1K":1,"2K":1,"4K":2}

Production guidance

  • Pass mode explicitly.
  • Use only option values listed above.
  • Upload media with POST /api/v1/files before calling media-input modes.
  • Use the exact model key for the variant you want.

Example: text to image

curl https://buble.ai/api/v1/generations \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-image-2",
    "mode": "text_to_image",
    "prompt": "A premium editorial product image of a minimalist ceramic coffee grinder on a warm walnut counter, soft studio lighting",
    "aspect_ratio": "16:9",
    "resolution": "1K"
  }'

Example: image to image

Upload an image first, then pass the returned URL to image_urls.

curl https://buble.ai/api/v1/generations \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-image-2",
    "mode": "image_to_image",
    "prompt": "Transform the source into a clean commercial product image while preserving the main object",
    "image_urls": ["https://example.com/source.png"],
    "aspect_ratio": "16:9",
    "resolution": "1K"
  }'