# gpt-image-1.5/edit

> GPT Image 1.5 Edit is OpenAI’s image model for precise, natural-language edits. Add/remove objects, swap backgrounds, retouch faces, adjust colors/lighting, edit text/graphics, crop/resize, and apply hex color control. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

- **Provider:** Openai
- **Category:** image-to-image
- **Price:** $0.0400 per run

## Key Features

- Transform existing images using text prompts while preserving key structural elements.
- Style transfer — apply artistic styles, color grading, or visual themes to source images.
- Intelligent inpainting and editing — modify specific regions while keeping the rest intact.
- Strength control — fine-tune how much the output deviates from the source image.
- Fast inference with consistent, high-quality results.
- Supports various input formats: JPEG, PNG, WebP.

## Parameters

| Parameter | Required | Description |
| --- | --- | --- |
| `prompt` | Yes | Text description of the desired transformation. |
| `images` | Yes | Source image URL(s) to transform. |
| `aspect_ratio` | No | Output aspect ratio (default: auto-detected from input). |
| `resolution` | No | Output resolution tier (default varies by model). |

## How to Use

1. Upload or provide a URL for your source image.
2. Write a prompt describing the desired transformation or style.
3. Adjust parameters to control how much the output differs from the original.
4. Generate and download your transformed image.

## Code Examples

### Python

```python
import os
import requests

response = requests.post(
    "https://aircube.ai/api/v3/gpt-image-1.5/edit",
    headers={
        "Authorization": "Bearer " + os.environ["AIRCUBE_API_KEY"],
        "Content-Type": "application/json",
    },
    json={
    "prompt": "Transform into a watercolor painting style",
    "images": [
        "https://example.com/input.jpg"
    ]
},
    timeout=300,
)
data = response.json()

if data["success"]:
    print("ID:", data["data"]["id"], "Status:", data["data"]["status"])
else:
    print("Error:", data["error"]["message"])
```

### Node.js

```javascript
const response = await fetch("https://aircube.ai/api/v3/gpt-image-1.5/edit", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.AIRCUBE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "prompt": "Transform into a watercolor painting style",
  "images": [
    "https://example.com/input.jpg"
  ]
}),
});

const data = await response.json();

if (data.success) {
  console.log("ID:", data.data.id, "Status:", data.data.status);
} else {
  console.error("Error:", data.error.message);
}
```

### cURL

```curl
curl -X POST "https://aircube.ai/api/v3/gpt-image-1.5/edit" \
  -H "Authorization: Bearer $AIRCUBE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "Transform into a watercolor painting style",
  "images": [
    "https://example.com/input.jpg"
  ]
}'
```

### Python (Async)

```python
import os
import time
import requests

# 1. Submit
response = requests.post(
    "https://aircube.ai/api/v3/gpt-image-1.5/edit",
    headers={
        "Authorization": "Bearer " + os.environ["AIRCUBE_API_KEY"],
        "Content-Type": "application/json",
    },
    json={
    "prompt": "Transform into a watercolor painting style",
    "images": [
        "https://example.com/input.jpg"
    ]
},
    timeout=300,
)
data = response.json()

if not data["success"]:
    print("Error:", data["error"]["message"])
    exit(1)

generation_id = data["data"]["id"]
print(f"Submitted: {generation_id}")

# 2. Poll until completed
while True:
    time.sleep(5)
    r = requests.get(
        f"https://aircube.ai/api/v3/status/{generation_id}",
        headers={"Authorization": "Bearer " + os.environ["AIRCUBE_API_KEY"]},
    )
    result = r.json()["data"]

    if result["status"] == "completed":
        print(result["output_url"])
        break
    elif result["status"] == "failed":
        print("Generation failed")
        break
```

### Node.js (Async)

```javascript
// 1. Submit
const response = await fetch("https://aircube.ai/api/v3/gpt-image-1.5/edit", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.AIRCUBE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "prompt": "Transform into a watercolor painting style",
  "images": [
    "https://example.com/input.jpg"
  ]
}),
});
const data = await response.json();

if (!data.success) {
  console.error("Error:", data.error.message);
  process.exit(1);
}

const generationId = data.data.id;
console.log("Submitted:", generationId);

// 2. Poll until completed
while (true) {
  await new Promise((r) => setTimeout(r, 5000));
  const res = await fetch(
    `https://aircube.ai/api/v3/status/${generationId}`,
    { headers: { "Authorization": "Bearer " + process.env.AIRCUBE_API_KEY } },
  );
  const result = (await res.json()).data;

  if (result.status === "completed") {
    console.log(result.output_url);
    break;
  } else if (result.status === "failed") {
    console.error("Generation failed");
    break;
  }
}
```

### cURL (Async)

```curl
# 1. Submit
RESPONSE=$(curl -s -X POST "https://aircube.ai/api/v3/gpt-image-1.5/edit" \
  -H "Authorization: Bearer $AIRCUBE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "Transform into a watercolor painting style",
  "images": [
    "https://example.com/input.jpg"
  ]
}')

ID=$(echo "$RESPONSE" | jq -r '.data.id')
echo "Submitted: $ID"

# 2. Poll until completed
while true; do
  sleep 5
  STATUS_RES=$(curl -s "https://aircube.ai/api/v3/status/$ID" \
    -H "Authorization: Bearer $AIRCUBE_API_KEY")
  STATUS=$(echo "$STATUS_RES" | jq -r '.data.status')

  if [ "$STATUS" = "completed" ]; then
    echo "$STATUS_RES" | jq -r '.data.output_url'
    break
  elif [ "$STATUS" = "failed" ]; then
    echo "Generation failed"; break
  fi
done
```

## Pricing

| Resolution | Duration | Cost |
| --- | --- | --- |
| 1k | low quality | $0.01 |
| 1k | medium quality | $0.04 |
| 1k | high quality | $0.14 |

### Billing Rules

- Pricing varies by quality x resolution combination.
- Low quality: $0.01 (1k).
- Medium quality: $0.04 (1k).
- High quality: $0.14 (1k).
- Failed generations are not charged.

## Best Use Cases

- Style transfer — convert photos into paintings, sketches or other artistic styles.
- Product visualization — change colors, materials or environments of product photos.
- Photo enhancement — improve lighting, add atmospheric effects, or change seasons.
- Brand asset adaptation — transform templates to match different campaigns or audiences.

## Pro Tips

- Use lower strength values to preserve more of the original structure.
- Higher strength gives the model more creative freedom for dramatic transformations.
- Upload high-resolution source images for the best output quality.
- Combine detailed prompts with moderate strength for controlled style changes.

## Notes

- Input images should be under 10 MB.
- Supported formats: JPEG, PNG, WebP.
- Aspect ratio of the output matches the input image by default.

## FAQ

**Q: What is the gpt-image-1.5/edit API?**

GPT Image 1.5 Edit is OpenAI’s image model for precise, natural-language edits. Add/remove objects, swap backgrounds, retouch faces, adjust colors/lighting, edit text/graphics, crop/resize, and apply hex color control. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

**Q: Can I edit specific regions of an image?**

Yes — use targeted prompts that describe changes to specific areas. For models with mask support, you can also provide an inpainting mask.

**Q: What resolution should my input image be?**

For best results, use images at 1024x1024 or higher. The output resolution matches the input.

**Q: Can I use gpt-image-1.5/edit outputs commercially?**

Yes — transformed images are yours to use commercially.
