Choose a model for the work you need to doMe
Official APIBeijingVersion 1
Tongyi image generation from Chinese prompts. A workspace for the selected region is required.
Image generation
API BASE URL
https://${WORKSPACE_ID}.cn-beijing.maas.aliyuncs.com/api/v1Actual API model ID
qwen-image-plusRequest method / path
POST /services/aigc/multimodal-generation/generationAuthentication
Authorization: Bearer $API_KEYEdit request parameters
Edit JSON within the verified parameter ranges. Copy and export stop if types, required fields, or enum values are invalid.
# 先在当前终端设置环境变量:API_KEY, WORKSPACE_ID
# 下面只创建请求文件,不执行文本中的任何命令。
cat > request.json <<'MODEL_ATLAS_REQUEST'
{
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "一幅简洁的春日植物插画"
}
]
}
]
},
"model": "qwen-image-plus"
}
MODEL_ATLAS_REQUEST
# 替换 request.json 内的用户占位符后再运行请求。
curl --fail-with-body --request POST "https://${WORKSPACE_ID}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${API_KEY}" \
--data-binary @request.json
