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
| Model | Mode | Label | Input requirements |
|---|---|---|---|
openai/gpt-image-2 | text_to_image | Text to Image | Prompt max 20000 chars |
openai/gpt-image-2 | image_to_image | Image to Image | Prompt max 20000 chars Images reference: 1-16 files, 10 MB, formats jpg, png, webp |
Options
| Model | Option | Default | Allowed values | Applies to |
|---|---|---|---|---|
openai/gpt-image-2 | resolution | 1K | 1K, 2K, 4K | All modes |
openai/gpt-image-2 | aspect_ratio | 16:9 | auto, 1:1, 16:9, 9:16, 4:3, 3:4 | All modes |
Pricing
| Model | Pricing |
|---|---|
openai/gpt-image-2 | 1 credit per image; option multipliers: resolution={"1K":1,"2K":1,"4K":2} |
Production guidance
- Pass
modeexplicitly. - Use only option values listed above.
- Upload media with
POST /api/v1/filesbefore 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"
}'