Get Generation Task
curl --request GET \
--url https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"task_info": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "completed",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"images": [
"<string>"
]
}{
"task_info": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "failed",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"error": {
"code": 3001,
"title": "Invalid Request",
"detail": "The prompt contains prohibited content"
}
}
}Qwen Image Edit Max
Qwen Image Edit Max Task
Retrieve the status and result of a generation task
GET
/
vendors
/
alibaba
/
v1
/
qwen-image-edit-max
/
generation
/
{task_id}
Get Generation Task
curl --request GET \
--url https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mulerouter.ai/vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"task_info": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "completed",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"images": [
"<string>"
]
}{
"task_info": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "failed",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"error": {
"code": 3001,
"title": "Invalid Request",
"detail": "The prompt contains prohibited content"
}
}
}Overview
Retrieve the status and result of a qwen-image-edit-max generation task.Task Status
| Status | Description |
|---|---|
pending | Task is waiting to be processed |
processing | Task is currently being processed |
completed | Task completed successfully |
failed | Task failed with an error |
Response
When the task is completed, the response will include the generated/edited image URLs in theimages array. Each URL is valid for 24 hours.
Example Responses
Completed Task
{
"task_info": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"status": "completed",
"created_at": "2025-02-09T10:30:00Z",
"updated_at": "2025-02-09T10:30:45Z"
},
"images": [
"https://example.com/edited-image-1.jpg",
"https://example.com/edited-image-2.jpg"
]
}
Pending Task
{
"task_info": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"status": "pending",
"created_at": "2025-02-09T10:30:00Z",
"updated_at": "2025-02-09T10:30:00Z"
}
}
Processing Task
{
"task_info": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"status": "processing",
"created_at": "2025-02-09T10:30:00Z",
"updated_at": "2025-02-09T10:30:15Z"
}
}
Failed Task
{
"task_info": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"status": "failed",
"created_at": "2025-02-09T10:30:00Z",
"updated_at": "2025-02-09T10:30:15Z",
"error": {
"code": 3001,
"title": "Invalid Request",
"detail": "The prompt contains prohibited content"
}
}
}
Polling Guidelines
For asynchronous task processing:- Initial Wait: Wait at least 2-3 seconds before the first poll
- Poll Interval: Poll every 2-3 seconds for
pendingorprocessingstatus - Timeout: Consider implementing a timeout (e.g., 5 minutes) for long-running tasks
- Exponential Backoff: Consider increasing poll intervals for longer tasks
Error Handling
If the task fails, check theerror object in task_info for details:
- code: Numeric error code identifying the error type
- title: Brief error description
- detail: Detailed explanation of what went wrong
- Invalid or prohibited content in prompt
- Image file size exceeds limit
- Unsupported image format
- Invalid resolution parameters
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

