---
title: "Qwen Image Edit Spicy API — image editing with up to 2 references, from $0.05 | APIMODELS"
description: "Qwen Image Edit Spicy image editing API: send the image to edit plus a text instruction and up to 2 reference images; the output keeps the main image's pixel size. $0.05 / $0.06 / $0.07 with 0 / 1 / 2 references, typically 8–20 s. One key, cURL/Python/Node examples."
canonical: https://apimodels.app/docs/qwen-image-edit-spicy
markdown: https://apimodels.app/docs/qwen-image-edit-spicy.md
language: en
source: "Generated from the HTML docs page at the canonical URL; the HTML page is the source of truth. Docs index: https://apimodels.app/llms.txt"
---

[Docs](https://apimodels.app/docs) · Qwen Image Edit Spicy API

# Qwen Image Edit Spicy API

Edit an image with a text instruction: send the image to edit (image 1), optionally up to 2 reference images (image 2 and image 3), and get one edited image back. The output has exactly the same pixel size as the image you edit, so there is no size or aspect ratio to choose. Typically 8–20 s. $0.05 with the main image only, $0.06 with 1 reference, $0.07 with 2, charged only on success.

## Authentication

```
Authorization: Bearer YOUR_API_KEY
```

## Model & pricing

| Input                     | Price           |
| ------------------------- | --------------- |
| Main image only           | $0.05 per image |
| Main image + 1 reference  | $0.06 per image |
| Main image + 2 references | $0.07 per image |

Set model to qwen-image-edit-spicy. The price depends only on the number of reference images, not on the main image size or seed. Examples: 100 edits with the main image only = $5.00; 100 edits with 2 reference images each = $7.00. Failed requests are not charged.

## Code examples

```bash
# ─── Edit one image with a text instruction ($0.05) ─────
curl -X POST https://api.apimodels.app/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-edit-spicy",
    "prompt": "Replace the background with a rainy neon street at night, keep the person unchanged",
    "image": "https://r2.apimodels.app/assets/muse-cases/20261030-cafe-date/ref-head.jpg"
  }'
# Response (async — a task is created):
# { "code": 200, "data": { "taskId": "clxxx", "state": "pending" } }

# ─── Main image + 2 reference images ($0.07) ───────────────
curl -X POST https://api.apimodels.app/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-edit-spicy",
    "prompt": "Put the white shirt dress from image 2 on the person in image 1, and use the coastal road from image 3 as the background",
    "image": "https://r2.apimodels.app/assets/muse-cases/20261030-cafe-date/ref-head.jpg",
    "reference_images": ["https://r2.apimodels.app/assets/muse-cases/20261030-sunset-beach/ref-turn.jpg", "https://apimodels.app/models/ltx-2.5-fast/action.jpg"],
    "seed": 42
  }'

# ─── Poll for the result ──────────────────────────────────
curl "https://api.apimodels.app/v1/images/generations?task_id=TASK_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"
# { "code": 200, "data": { "state": "completed", "resultUrls": ["https://r2.apimodels.app/..."] } }
```

```python
import requests, time

ENDPOINT = "https://api.apimodels.app/v1/images/generations"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}

# 1. Create the task: the image to edit + an instruction (+ up to 2 reference images)
create = requests.post(ENDPOINT, headers=HEADERS, json={
    "model": "qwen-image-edit-spicy",
    "prompt": "Put the white shirt dress from image 2 on the person in image 1",
    "image": "https://r2.apimodels.app/assets/muse-cases/20261030-cafe-date/ref-head.jpg",              # image 1: URL or base64
    "reference_images": ["https://r2.apimodels.app/assets/muse-cases/20261030-sunset-beach/ref-turn.jpg"],  # optional, up to 2 (+$0.01 each)
    "seed": 42,                                              # optional: repeatable output
})
task_id = create.json()["data"]["taskId"]

# 2. Poll until completed (typically 8-20 s)
while True:
    data = requests.get(ENDPOINT, headers=HEADERS, params={"task_id": task_id}).json()["data"]
    if data["state"] == "completed":
        print(data["resultUrls"]); break
    if data["state"] == "failed":
        raise RuntimeError(data.get("failMsg") or "failed")
    time.sleep(2)
```

```javascript
const ENDPOINT = "https://api.apimodels.app/v1/images/generations";
const HEADERS = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" };

// 1. Create the task: the image to edit + an instruction (+ up to 2 reference images)
const create = await fetch(ENDPOINT, {
  method: "POST",
  headers: HEADERS,
  body: JSON.stringify({
    model: "qwen-image-edit-spicy",
    prompt: "Put the white shirt dress from image 2 on the person in image 1",
    image: "https://r2.apimodels.app/assets/muse-cases/20261030-cafe-date/ref-head.jpg",               // image 1: URL or base64
    reference_images: ["https://r2.apimodels.app/assets/muse-cases/20261030-sunset-beach/ref-turn.jpg"],  // optional, up to 2 (+$0.01 each)
    seed: 42,                                              // optional: repeatable output
  }),
});
const taskId = (await create.json()).data.taskId;

// 2. Poll until completed (typically 8-20 s)
while (true) {
  const res = await fetch(ENDPOINT + "?task_id=" + taskId, { headers: HEADERS });
  const { data } = await res.json();
  if (data.state === "completed") { console.log(data.resultUrls); break; }
  if (data.state === "failed") throw new Error(data.failMsg || "failed");
  await new Promise(r => setTimeout(r, 2000));
}
```

## Request parameters

| Field                            | Required | Type       | Description                                                                                                                                                      |
| -------------------------------- | -------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| model                            | Yes      | string     | qwen-image-edit-spicy                                                                                                                                            |
| prompt                           | Yes      | string     | The edit instruction. The image to edit is image 1; reference images are image 2 and image 3 in order                                                            |
| image                            | Yes      | string     | The image to edit, as a URL or base64 (image_url / image_base64, or the first entry of image_urls, also work). The output follows its composition and pixel size |
| reference_images                 | No       | string\[\] | Up to 2 reference images, as URLs or base64; +$0.01 each. Entries of image_urls after the main image count as references too                                     |
| seed                             | No       | number     | Random seed (0 to 2147483647) for reproducible output; omitted or 0 means random                                                                                 |
| callback_url                     | No       | string     | Webhook URL called when the task completes                                                                                                                       |
| size / aspect_ratio / resolution | No       | string     | Accepted and ignored, never an error: the output size always equals the main image size                                                                          |

## Notes

- The output has exactly the main image's pixel size (2048x1136 in, 2048x1136 out). Very large inputs such as 3840x2160 keep their size, but fine detail is closer to a 2K render; for the sharpest result send a main image around 2K
- At most 3 images per request (main + 2 references); more is a 400 and is not charged, extra images are never silently dropped. reference_images without a main image is also a 400
- No mask (a 400 if sent): say in the instruction which area to change. One image per request (n greater than 1 is a 400)
- Async: create a task for a taskId, then poll GET ?task_id= or pass a callback_url. With an OpenAI-style size and no callback_url the image is returned in the same response; the size value itself does not change the output size
- Result files are deleted after 30 days; download or re-host them in time
- Charged only on success

Try it in the [Playground](https://apimodels.app/models/qwen-image-edit-spicy)
