Category: provider
Model Studio Z-Image Turbo
Use Z-Image Turbo for fast text-to-image generation via the DashScope multimodal-generation API.
Critical model name
Use ONLY this exact model string:
Prerequisites
- Set
DASHSCOPE_API_KEY in your environment, or add dashscope_api_key to ~/.alibabacloud/credentials (env takes precedence).
- Choose region endpoint (Beijing or Singapore). If unsure, pick the most reasonable region or ask the user.
Normalized interface (image.generate)
Request
prompt (string, required)
size (string, optional) e.g. 1024*1024
seed (int, optional)
prompt_extend (bool, optional; default false)
base_url (string, optional) override API endpoint
Response
image_url (string)
width (int)
height (int)
prompt (string)
rewritten_prompt (string, optional)
reasoning (string, optional)
request_id (string)
Quick start (curl)
curl -sS 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-d '{
"model": "z-image-turbo",
"input": {
"messages": [
{
"role": "user",
"content": [{"text": "A calm lake at dawn, a lone angler casting a line, cinematic lighting"}]
}
]
},
"parameters": {
"size": "1024*1024",
"prompt_extend": false
}
}'
Local helper script
python skills/ai/image/aliyun-zimage-turbo/scripts/generate_image.py \
--request '{"prompt":"a fishing scene at dawn, cinematic, realistic","size":"1024*1024"}' \
--output output/ai-image-zimage-turbo/images/fishing.png \
--print-response
Size notes
- Total pixels must be between
512*512 and 2048*2048.
- Prefer common sizes like
1024*1024, 1280*720, 1536*864.
Cost note
prompt_extend=true is billed higher than false. Only enable when you need rewritten prompts.
Output location
- Default output:
output/ai-image-zimage-turbo/images/
- Override base dir with
OUTPUT_DIR.
Validation
mkdir -p output/aliyun-zimage-turbo
for f in skills/ai/image/aliyun-zimage-turbo/scripts/*.py; do
python3 -m py_compile "$f"
done
echo "py_compile_ok" > output/aliyun-zimage-turbo/validate.txt
Pass criteria: command exits 0 and output/aliyun-zimage-turbo/validate.txt is generated.
Output And Evidence
- Save artifacts, command outputs, and API response summaries under
output/aliyun-zimage-turbo/.
- Include key parameters (region/resource id/time range) in evidence files for reproducibility.
Workflow
- Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
- Run one minimal read-only query first to verify connectivity and permissions.
- Execute the target operation with explicit parameters and bounded scope.
- Verify results and save output/evidence files.
References
references/api_reference.md for request/response schema and regional endpoints.
references/sources.md for official docs.
1---
2name: aliyun-zimage-turbo
3description: Use when generating images with Alibaba Cloud Model Studio Z-Image Turbo (z-image-turbo) via DashScope multimodal-generation API. Use when creating text-to-image outputs, controlling size/seed/prompt_extend, or documenting request/response mapping for Z-Image.
4version: 1.0.0
5---
6
7Category: provider
8
9# Model Studio Z-Image Turbo
10
11Use Z-Image Turbo for fast text-to-image generation via the DashScope multimodal-generation API.
12
13## Critical model name
14
15Use ONLY this exact model string:
16- `z-image-turbo`
17
18## Prerequisites
19
20- Set `DASHSCOPE_API_KEY` in your environment, or add `dashscope_api_key` to `~/.alibabacloud/credentials` (env takes precedence).
21- Choose region endpoint (Beijing or Singapore). If unsure, pick the most reasonable region or ask the user.
22
23## Normalized interface (image.generate)
24
25### Request
26- `prompt` (string, required)
27- `size` (string, optional) e.g. `1024*1024`
28- `seed` (int, optional)
29- `prompt_extend` (bool, optional; default false)
30- `base_url` (string, optional) override API endpoint
31
32### Response
33- `image_url` (string)
34- `width` (int)
35- `height` (int)
36- `prompt` (string)
37- `rewritten_prompt` (string, optional)
38- `reasoning` (string, optional)
39- `request_id` (string)
40
41## Quick start (curl)
42
43```bash
44curl -sS 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
45 -H 'Content-Type: application/json' \
46 -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
47 -d '{
48 "model": "z-image-turbo",
49 "input": {
50 "messages": [
51 {
52 "role": "user",
53 "content": [{"text": "A calm lake at dawn, a lone angler casting a line, cinematic lighting"}]
54 }
55 ]
56 },
57 "parameters": {
58 "size": "1024*1024",
59 "prompt_extend": false
60 }
61 }'
62```
63
64## Local helper script
65
66```bash
67python skills/ai/image/aliyun-zimage-turbo/scripts/generate_image.py \
68 --request '{"prompt":"a fishing scene at dawn, cinematic, realistic","size":"1024*1024"}' \
69 --output output/ai-image-zimage-turbo/images/fishing.png \
70 --print-response
71```
72
73## Size notes
74
75- Total pixels must be between `512*512` and `2048*2048`.
76- Prefer common sizes like `1024*1024`, `1280*720`, `1536*864`.
77
78## Cost note
79
80- `prompt_extend=true` is billed higher than `false`. Only enable when you need rewritten prompts.
81
82## Output location
83
84- Default output: `output/ai-image-zimage-turbo/images/`
85- Override base dir with `OUTPUT_DIR`.
86
87## Validation
88
89```bash
90mkdir -p output/aliyun-zimage-turbo
91for f in skills/ai/image/aliyun-zimage-turbo/scripts/*.py; do
92 python3 -m py_compile "$f"
93done
94echo "py_compile_ok" > output/aliyun-zimage-turbo/validate.txt
95```
96
97Pass criteria: command exits 0 and `output/aliyun-zimage-turbo/validate.txt` is generated.
98
99## Output And Evidence
100
101- Save artifacts, command outputs, and API response summaries under `output/aliyun-zimage-turbo/`.
102- Include key parameters (region/resource id/time range) in evidence files for reproducibility.
103
104## Workflow
105
1061) Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
1072) Run one minimal read-only query first to verify connectivity and permissions.
1083) Execute the target operation with explicit parameters and bounded scope.
1094) Verify results and save output/evidence files.
110
111## References
112
113- `references/api_reference.md` for request/response schema and regional endpoints.
114- `references/sources.md` for official docs.