curl --request POST \
--url https://api.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "qwen-image-2.0-pro",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"image": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp"
},
{
"text": "在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。"
}
]
}
]
},
"parameters": {
"n": 1,
"negative_prompt": " ",
"prompt_extend": true,
"watermark": false,
"size": "2048*2048"
}
}
'import requests
url = "https://api.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation"
payload = {
"model": "qwen-image-2.0-pro",
"input": { "messages": [
{
"role": "user",
"content": [{ "image": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp" }, { "text": "在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。" }]
}
] },
"parameters": {
"n": 1,
"negative_prompt": " ",
"prompt_extend": True,
"watermark": False,
"size": "2048*2048"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'qwen-image-2.0-pro',
input: {
messages: [
{
role: 'user',
content: [
{
image: 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp'
},
{
text: '在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。'
}
]
}
]
},
parameters: {
n: 1,
negative_prompt: ' ',
prompt_extend: true,
watermark: false,
size: '2048*2048'
}
})
};
fetch('https://api.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation', 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.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'qwen-image-2.0-pro',
'input' => [
'messages' => [
[
'role' => 'user',
'content' => [
[
'image' => 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp'
],
[
'text' => '在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。'
]
]
]
]
],
'parameters' => [
'n' => 1,
'negative_prompt' => ' ',
'prompt_extend' => true,
'watermark' => false,
'size' => '2048*2048'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation"
payload := strings.NewReader("{\n \"model\": \"qwen-image-2.0-pro\",\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"image\": \"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp\"\n },\n {\n \"text\": \"在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。\"\n }\n ]\n }\n ]\n },\n \"parameters\": {\n \"n\": 1,\n \"negative_prompt\": \" \",\n \"prompt_extend\": true,\n \"watermark\": false,\n \"size\": \"2048*2048\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"qwen-image-2.0-pro\",\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"image\": \"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp\"\n },\n {\n \"text\": \"在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。\"\n }\n ]\n }\n ]\n },\n \"parameters\": {\n \"n\": 1,\n \"negative_prompt\": \" \",\n \"prompt_extend\": true,\n \"watermark\": false,\n \"size\": \"2048*2048\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"qwen-image-2.0-pro\",\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"image\": \"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp\"\n },\n {\n \"text\": \"在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。\"\n }\n ]\n }\n ]\n },\n \"parameters\": {\n \"n\": 1,\n \"negative_prompt\": \" \",\n \"prompt_extend\": true,\n \"watermark\": false,\n \"size\": \"2048*2048\"\n }\n}"
response = http.request(request)
puts response.read_body{
"output": {
"choices": [
{
"finish_reason": "stop",
"message": {
"content": [
{
"image": "https://dashscope-result-sz.oss-cn-shenzhen.aliyuncs.com/xxx.png?Expires=xxx"
}
],
"role": "assistant"
}
}
]
},
"usage": {
"height": 2048,
"image_count": 1,
"width": 2048
},
"request_id": "571ae02f-5c9d-436c-83c2-f221e6df0xxx"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}Qwen image edit
Calls the Ali qwen-image-2.0-pro model to perform image editing. The input.messages[0].content[] array must contain 1-3 image objects (input image URL or Base64 data) and 1 text object (edit instruction). The parameters field controls output count n, negative prompt negative_prompt, resolution size, smart prompt rewriting prompt_extend, watermark watermark, and random seed seed.
curl --request POST \
--url https://api.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "qwen-image-2.0-pro",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"image": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp"
},
{
"text": "在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。"
}
]
}
]
},
"parameters": {
"n": 1,
"negative_prompt": " ",
"prompt_extend": true,
"watermark": false,
"size": "2048*2048"
}
}
'import requests
url = "https://api.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation"
payload = {
"model": "qwen-image-2.0-pro",
"input": { "messages": [
{
"role": "user",
"content": [{ "image": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp" }, { "text": "在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。" }]
}
] },
"parameters": {
"n": 1,
"negative_prompt": " ",
"prompt_extend": True,
"watermark": False,
"size": "2048*2048"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'qwen-image-2.0-pro',
input: {
messages: [
{
role: 'user',
content: [
{
image: 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp'
},
{
text: '在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。'
}
]
}
]
},
parameters: {
n: 1,
negative_prompt: ' ',
prompt_extend: true,
watermark: false,
size: '2048*2048'
}
})
};
fetch('https://api.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation', 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.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'qwen-image-2.0-pro',
'input' => [
'messages' => [
[
'role' => 'user',
'content' => [
[
'image' => 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp'
],
[
'text' => '在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。'
]
]
]
]
],
'parameters' => [
'n' => 1,
'negative_prompt' => ' ',
'prompt_extend' => true,
'watermark' => false,
'size' => '2048*2048'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation"
payload := strings.NewReader("{\n \"model\": \"qwen-image-2.0-pro\",\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"image\": \"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp\"\n },\n {\n \"text\": \"在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。\"\n }\n ]\n }\n ]\n },\n \"parameters\": {\n \"n\": 1,\n \"negative_prompt\": \" \",\n \"prompt_extend\": true,\n \"watermark\": false,\n \"size\": \"2048*2048\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"qwen-image-2.0-pro\",\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"image\": \"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp\"\n },\n {\n \"text\": \"在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。\"\n }\n ]\n }\n ]\n },\n \"parameters\": {\n \"n\": 1,\n \"negative_prompt\": \" \",\n \"prompt_extend\": true,\n \"watermark\": false,\n \"size\": \"2048*2048\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/ali/api/v1/services/aigc/multimodal-generation/generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"qwen-image-2.0-pro\",\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"image\": \"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp\"\n },\n {\n \"text\": \"在画面右下角石板路旁、靠近树干根部的位置,以浅灰墨色手写体题写一首七言绝句,字体为行楷风格,笔触自然流畅、略带飞白,大小适中(约占画面高度1/10),与整体水墨淡雅氛围协调。诗文内容为:“青石桥畔柳风轻, 素手拈花闭目听。 一水碧痕浮旧梦, 半篙烟雨入空舲。”诗句横向排列,四句分两行书写(前两句一行,后两句一行),末句“舲”字右下角钤一枚朱红小印,印文为“江南”二字篆书,尺寸约等于单字高度的1/3。\"\n }\n ]\n }\n ]\n },\n \"parameters\": {\n \"n\": 1,\n \"negative_prompt\": \" \",\n \"prompt_extend\": true,\n \"watermark\": false,\n \"size\": \"2048*2048\"\n }\n}"
response = http.request(request)
puts response.read_body{
"output": {
"choices": [
{
"finish_reason": "stop",
"message": {
"content": [
{
"image": "https://dashscope-result-sz.oss-cn-shenzhen.aliyuncs.com/xxx.png?Expires=xxx"
}
],
"role": "assistant"
}
}
]
},
"usage": {
"height": 2048,
"image_count": 1,
"width": 2048
},
"request_id": "571ae02f-5c9d-436c-83c2-f221e6df0xxx"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}{
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}Authorizations
Pass Authorization: Bearer <token> in the request header.
Body
Response
Success. Returns the image edit result.
Contains model generation results.
Show child attributes
Show child attributes
Resource usage for this call. Returned only when the call succeeds.
Show child attributes
Show child attributes
Unique request identifier. It can be used for request traceability and troubleshooting.
Error code returned when the request fails. This parameter is not returned on success.
Detailed error message returned when the request fails. This parameter is not returned on success.