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.
Autenticación
Authorization: Bearer YOUR_API_KEYModel & pricing
| Entrada | 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
# ─── 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://example.com/portrait.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 jacket from image 2 on the person in image 1, and use the street from image 3 as the background",
"image": "https://example.com/person.jpg",
"reference_images": ["https://example.com/jacket.jpg", "https://example.com/street.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/..."] } }Parámetros de la solicitud
| 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 |
Notas
- 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