Allowed scope
Only image generation, video generation, and task query are exposed. Text, audio, file, and model-management DashScope APIs are not proxied through this namespace.
Two-step native flow
① Submit a DashScope video task
POST /dashscope/api/v1/services/aigc/video-generation/video-synthesisNative DashScope JSONRequiredUse the native DashScope model, input, and parameters body. Routing changes only model to the selected supply route's upstream model ID; all other fields are submitted unchanged.
Submit a DashScope image task
POST /dashscope/api/v1/services/aigc/text2image/image-synthesisNative DashScope JSONRequiredThe legacy text2image endpoint is submitted asynchronously as required by DashScope. Query its output.task_id through the shared task endpoint.
POST /dashscope/api/v1/services/aigc/multimodal-generation/generationNative DashScope JSONRequiredThe newer multimodal-generation endpoint supports synchronous responses. If the client sends X-DashScope-Async, the task is persisted and can be queried later.
② Query the DashScope task
GET /dashscope/api/v1/tasks/:idPlatform task idRequiredQuery with output.task_id. Successful video returns output.video_url; successful image returns output.results. The first success settles billing idempotently.
A platform task ID is returned by default to hide upstream account and task identifiers. When a customer group explicitly enables upstream-task-ID passthrough, the native DashScope task_id can also be queried directly.
Billing model
Balance is reserved before submission: video by duration and resolution, image by count and size. Success settles the charge and failure releases the reservation. The model must be listed and either priced or explicitly free.
Request and response bodies
Use the examples below to verify the request and response structures. To send a request, select Debug at the top of the page.
① Submit a DashScope video task
curl https://zerofa.ai/dashscope/api/v1/services/aigc/video-generation/video-synthesis \
-H "Authorization: Bearer sk-zerofa-xxx" \
-H "Content-Type: application/json" \
-H "X-DashScope-Async: enable" \
-d '{
"model": "your-dashscope-video-model-id",
"input": { "prompt": "一只白马穿过晨雾" },
"parameters": {
"duration": 5,
"resolution": "1080P",
"ratio": "16:9",
"watermark": false
}
}'
# {"request_id":"...","output":{"task_id":"...","task_status":"PENDING"}}Submit a DashScope image task
curl https://zerofa.ai/dashscope/api/v1/services/aigc/text2image/image-synthesis \
-H "Authorization: Bearer sk-zerofa-xxx" \
-H "Content-Type: application/json" \
-H "X-DashScope-Async: enable" \
-d '{
"model": "your-dashscope-image-model-id",
"input": { "prompt": "一间晨光中的花店" },
"parameters": { "size": "1024*1024", "n": 1 }
}'
# 查询仍使用 GET /dashscope/api/v1/tasks/TASK_ID② Query the DashScope task
curl https://zerofa.ai/dashscope/api/v1/tasks/TASK_ID \
-H "Authorization: Bearer sk-zerofa-xxx"
# {"request_id":"...","output":{"task_id":"...","task_status":"SUCCEEDED","video_url":"https://..."}}