Gpt Image 2 Edit
OpenAI's GPT Image 2 Edit enables image editing from natural-language instructions with one or more reference images. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Key Features
- Natural-language editing — describe changes in plain English without manual masking or complex tools.
- Reference image support — provide up to 16 input images for context, style transfer, or multi-image composition.
- Flexible aspect ratios — auto-detected from input or manually specified.
- No manual masking required — the model intelligently infers edit regions from your prompt.
- Multiple quality and resolution tiers for cost optimization.
- Seamless blending — edits integrate naturally with the existing image content.
Parameters
| Parameter | Required | Description |
|---|---|---|
| prompt | Yes | Description of the edit to apply. |
| images | Yes | 1-16 source image URLs to edit or use as reference. |
| aspect_ratio | No | Output aspect ratio (default: auto-detected from input). |
| resolution | No | Output resolution: '1k', '2k', or '4k' (default: '1k'). |
| quality | No | Quality level: 'low', 'medium' (default), or 'high'. |
| output_format | No | Output format: 'png', 'jpeg', or 'webp'. |
| enable_sync_mode | No | Enable synchronous response mode. |
| enable_base64_output | No | Return base64-encoded image data. |
How to Use
- Provide one or more source images (up to 16 URLs).
- Describe the change you want — be specific about what to add, remove, or modify.
- Select quality and resolution based on your needs.
- Generate and download your edited image.
Code Examples
import os
import requests
response = requests.post(
"https://aircube.ai/api/v3/gpt-image-2/edit",
headers={
"Authorization": "Bearer " + os.environ["AIRCUBE_API_KEY"],
"Content-Type": "application/json",
},
json={
"prompt": "Remove the person in the background and replace with a clean beach landscape, maintain warm lighting",
"images": [
"https://example.com/beach-photo.jpg"
],
"quality": "medium",
"resolution": "2k"
},
timeout=300,
)
data = response.json()
if data["success"]:
print("ID:", data["data"]["id"], "Status:", data["data"]["status"])
else:
print("Error:", data["error"]["message"])Pricing
| Resolution | Duration | Cost |
|---|---|---|
| 1k | low quality | $0.02 |
| 2k | low quality | $0.03 |
| 4k | low quality | $0.04 |
| 1k | medium quality | $0.07 |
| 2k | medium quality | $0.11 |
| 4k | medium quality | $0.19 |
| 1k | high quality | $0.23 |
| 2k | high quality | $0.41 |
| 4k | high quality | $0.73 |
Billing rules
- Pricing varies by quality x resolution combination.
- Low quality: $0.02 (1k), $0.03 (2k), $0.04 (4k).
- Medium quality: $0.07 (1k), $0.11 (2k), $0.19 (4k).
- High quality: $0.23 (1k), $0.41 (2k), $0.73 (4k).
- Failed generations are not charged.
Best Use Cases
- Product photo enhancement — improve lighting, background, and presentation of product images.
- Creative retouching — modify elements, add effects, or change visual style.
- Marketing asset adaptation — adjust images for different campaigns, audiences, or platforms.
- Social media reformatting — adapt images for different aspect ratios and contexts.
- Design iteration — rapidly explore variations of a concept without manual editing.
- E-commerce optimization — enhance product images for better conversion.
Pro Tips
- Be specific about what to change — 'replace the red car with a blue bicycle' is better than 'change the vehicle'.
- No manual masking needed — the model infers edit regions from your prompt description.
- Provide multiple reference images (up to 16) for style transfer or multi-image composition tasks.
- Describe the desired result, not the process: 'a sunny sky' rather than 'remove the clouds'.
- Use high-quality source images for the best edit blending.
Notes
- Supports up to 16 input images per request.
- Aspect ratio auto-detected from input when not specified.
- Output formats: PNG, JPEG, or WebP.
- Median generation time: approximately 64 seconds.





