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.
Authorization: Bearer YOUR_API_KEY| 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.
# ─── 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/..."] } }| 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 |
Try it in the Playground