Video generation: create a Wan3.0 video task
curl --request POST \
--url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data '
{
"model": "wan3.0-video",
"input": {
"prompt": "A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting"
}
}
'import requests
url = "https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis"
payload = {
"model": "wan3.0-video",
"input": { "prompt": "A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting" }
}
headers = {
"X-DashScope-Async": "<x-dashscope-async>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-DashScope-Async': '<x-dashscope-async>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'wan3.0-video',
input: {
prompt: 'A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting'
}
})
};
fetch('https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis', 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.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis",
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' => 'wan3.0-video',
'input' => [
'prompt' => 'A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-DashScope-Async: <x-dashscope-async>"
],
]);
$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.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis"
payload := strings.NewReader("{\n \"model\": \"wan3.0-video\",\n \"input\": {\n \"prompt\": \"A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-DashScope-Async", "<x-dashscope-async>")
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.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis")
.header("X-DashScope-Async", "<x-dashscope-async>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"wan3.0-video\",\n \"input\": {\n \"prompt\": \"A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-DashScope-Async"] = '<x-dashscope-async>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"wan3.0-video\",\n \"input\": {\n \"prompt\": \"A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting\"\n }\n}"
response = http.request(request)
puts response.read_body{
"output": {
"task_id": "9db29626-79fc-40d1-b9c2-c6b0caf8ac15",
"task_status": "PENDING"
},
"request_id": "e616d8c9-1147-9ecd-b2b5-abbbe89a4642"
}Wan3.0 동영상 생성 (Alibaba)
Wan3.0 동영상 생성 API 레퍼런스
Wan3.0 동영상 생성 API 레퍼런스 및 실시간 Playground: 단일 모델 ID로 텍스트-투-비디오, 이미지-투-비디오, 레퍼런스-투-비디오 및 동영상 편집을 지원하며, 최대 30초, 480P-1080P, DashScope 비동기 패스스루 엔드포인트를 제공합니다.
POST
/
wan
/
api
/
v1
/
services
/
aigc
/
video-generation
/
video-synthesis
Video generation: create a Wan3.0 video task
curl --request POST \
--url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data '
{
"model": "wan3.0-video",
"input": {
"prompt": "A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting"
}
}
'import requests
url = "https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis"
payload = {
"model": "wan3.0-video",
"input": { "prompt": "A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting" }
}
headers = {
"X-DashScope-Async": "<x-dashscope-async>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-DashScope-Async': '<x-dashscope-async>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'wan3.0-video',
input: {
prompt: 'A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting'
}
})
};
fetch('https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis', 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.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis",
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' => 'wan3.0-video',
'input' => [
'prompt' => 'A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-DashScope-Async: <x-dashscope-async>"
],
]);
$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.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis"
payload := strings.NewReader("{\n \"model\": \"wan3.0-video\",\n \"input\": {\n \"prompt\": \"A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-DashScope-Async", "<x-dashscope-async>")
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.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis")
.header("X-DashScope-Async", "<x-dashscope-async>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"wan3.0-video\",\n \"input\": {\n \"prompt\": \"A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-DashScope-Async"] = '<x-dashscope-async>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"wan3.0-video\",\n \"input\": {\n \"prompt\": \"A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, seagulls, cinematic lighting\"\n }\n}"
response = http.request(request)
puts response.read_body{
"output": {
"task_id": "9db29626-79fc-40d1-b9c2-c6b0caf8ac15",
"task_status": "PENDING"
},
"request_id": "e616d8c9-1147-9ecd-b2b5-abbbe89a4642"
}오른쪽의 Playground를 사용하여 직접 테스트할 수 있습니다. Authorization에
Bearer sk-your-api-key을(를) 입력하고, model / input / parameters을(를) 채운 다음 전송하십시오. 성공적으로 제출되면 task_id이(가) 반환되며, 폴링 및 다운로드는 아래에서 다룹니다.Wan3.0은 단일 모델 ID로 모든 모드를 지원합니다 — 전송하는 미디어에 따라 동작 방식이 결정됩니다. 전체 비동기 워크플로, 상태 표, 과금 규칙 및 Python 클라이언트는 Wan3.0 개요에서 확인할 수 있습니다.
- 생성 요청은 반드시
X-DashScope-Async: enable헤더와 함께/wan/api/v1/services/aigc/video-generation/video-synthesis(으)로 전송해야 합니다./v1/videos은(는) 사용하지 마십시오(미디어 필드가 누락되고 과금이 부정확해집니다). duration은(는) 반드시 정수(5이며,"5"이 아님)여야 하고,resolution은(는) 대문자(720P)(으)로 작성해야 합니다.- 최종 상태는
completed/failed이며,SUCCEEDED이(가) 아닙니다.
네 가지 모드, 하나의 필드
| 모드 | media에 입력할 내용 |
|---|---|
| 텍스트-동영상 | media 생략 |
| 이미지-동영상 | [{ "type": "first_frame", "url": "..." }] |
| 첫/마지막 프레임 동영상 | first_frame + last_frame |
| 참조-동영상 | reference_image / reference_video / reference_audio (혼합 가능) |
first_frame / last_frame은 reference_* / file / link와 혼합할 수 없습니다.코드 예제
curl -X POST "https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis" \
-H "X-DashScope-Async: enable" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks, cinematic lighting"
},
"parameters": {
"resolution": "720P",
"ratio": "16:9",
"duration": 5,
"prompt_extend": true
}
}'
import requests
url = "https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis"
headers = {
"Authorization": "Bearer sk-your-api-key",
"Content-Type": "application/json",
"X-DashScope-Async": "enable", # required when creating a task
}
body = {
"model": "wan3.0-video",
"input": {"prompt": "A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks"},
"parameters": {"resolution": "720P", "ratio": "16:9", "duration": 5, "prompt_extend": True},
}
resp = requests.post(url, json=body, headers=headers, timeout=30)
task_id = resp.json()["output"]["task_id"]
print("task_id:", task_id)
const res = await fetch(
"https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis",
{
method: "POST",
headers: {
Authorization: "Bearer sk-your-api-key",
"Content-Type": "application/json",
"X-DashScope-Async": "enable",
},
body: JSON.stringify({
model: "wan3.0-video",
input: { prompt: "A lighthouse by the sea at dusk, slow dolly-in, waves on the rocks" },
parameters: { resolution: "720P", ratio: "16:9", duration: 5, prompt_extend: true },
}),
}
);
const data = await res.json();
console.log("task_id:", data.output.task_id);
이미지 투 비디오 (첫 프레임)
{
"model": "wan3.0-video",
"input": {
"prompt": "The cat turns toward the camera and blinks",
"media": [{ "type": "first_frame", "url": "https://example.com/cat.jpg" }]
},
"parameters": { "resolution": "720P", "duration": 5 }
}
레퍼런스 투 비디오 (참조 이미지 + 참조 동영상)
{
"model": "wan3.0-video-prime",
"input": {
"prompt": "Replace the person in video 1 with the person in image 1, keep everything else",
"media": [
{ "type": "reference_image", "url": "https://example.com/person.jpg" },
{ "type": "reference_video", "url": "https://example.com/source.mp4" }
]
},
"parameters": { "resolution": "720P", "ratio": "9:16", "duration": 5 }
}
참조 동영상 길이에 대해 과금됩니다. 위의 예시에서 10초 길이의 참조와 5초의 출력은 15초로 과금됩니다. 입력 + 출력은 최대 30초로 제한됩니다. 자세한 내용은 과금 규칙을 참고하십시오.
폴링 및 다운로드
# Poll every 5-10 seconds (never below 3)
curl "https://api.apiyi.com/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer sk-your-api-key"
# Download: result_url is a signed OSS link - do not send Authorization
curl -o out.mp4 "$RESULT_URL"
| 상태 | 의미 | 다음 단계 |
|---|---|---|
submitted | 대기 중 | 계속 폴링 |
in_progress | 생성 중 | 계속 폴링 |
completed | 완료 | result_url에서 다운로드 |
failed | 실패 | error.message 확인; 과금되지 않음 |
한눈에 보는 가격
기본 요율은 **Alibaba 공식 가격의 98%**이며, 최대 충전 보너스 적용 시 **약 81.7%**까지 낮아집니다.| 모델 | 해상도 | 기본 요금 | 10% 보너스 적용 시 | 20% 보너스 적용 시 | 20% 보너스 적용 가격(CNY) |
|---|---|---|---|---|---|
wan3.0-video | 480P | $0.0294/초 | $0.0267/초 | $0.0245/초 | ¥0.1715/초 |
wan3.0-video | 720P | $0.0588/초 | $0.0535/초 | $0.049/초 | ¥0.343/초 |
wan3.0-video | 1080P | $0.1176/초 | $0.1069/초 | $0.098/초 | ¥0.686/초 |
wan3.0-video-prime | 480P | $0.063/초 | $0.0573/초 | $0.0525/초 | ¥0.3675/초 |
wan3.0-video-prime | 720P | $0.126/초 | $0.1145/초 | $0.105/초 | ¥0.735/초 |
wan3.0-video-prime | 1080P | $0.252/초 | $0.2291/초 | $0.21/초 | ¥1.47/초 |
가격은 제공업체의 공식 요율을 따르며 이에 따라 변경될 수 있습니다. 위 표는 참고용일 뿐이며, 상단 내비게이션의 모델 가격 탭을 기준으로 합니다: 모델 가격.
전체 파라미터, 과금 규칙 및 모범 사례
Wan3.0 개요
인증
APIYI API key, format: Bearer sk-your-api-key
헤더
Async switch. Must be set to enable, otherwise the upstream returns: current user api does not support synchronous calls
사용 가능한 옵션:
enable 본문
application/json
이 페이지가 도움이 되었나요?