文生视频 (官方格式)
curl --request POST \
--url https://api.maxapi.ai/wan/api/v1/services/aigc/text2video/text-to-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "wan2.5-t2v-preview",
"input": {
"prompt": "一只可爱的小猫在草地上玩耍"
}
}
'import requests
url = "https://api.maxapi.ai/wan/api/v1/services/aigc/text2video/text-to-video"
payload = {
"model": "wan2.5-t2v-preview",
"input": { "prompt": "一只可爱的小猫在草地上玩耍" }
}
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: 'wan2.5-t2v-preview', input: {prompt: '一只可爱的小猫在草地上玩耍'}})
};
fetch('https://api.maxapi.ai/wan/api/v1/services/aigc/text2video/text-to-video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maxapi.ai/wan/api/v1/services/aigc/text2video/text-to-video"
payload := strings.NewReader("{\n \"model\": \"wan2.5-t2v-preview\",\n \"input\": {\n \"prompt\": \"一只可爱的小猫在草地上玩耍\"\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.maxapi.ai/wan/api/v1/services/aigc/text2video/text-to-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"wan2.5-t2v-preview\",\n \"input\": {\n \"prompt\": \"一只可爱的小猫在草地上玩耍\"\n }\n}")
.asString();{
"output": {
"task_id": "task_123456",
"task_status": "PENDING"
},
"request_id": "req_123456",
"usage": {
"duration": 5
}
}使用文本提示词生成视频,兼容阿里云官方API格式
POST
https://api.maxapi.ai
/
wan
/
api
/
v1
/
services
/
aigc
/
text2video
/
text-to-video
文生视频 (官方格式)
curl --request POST \
--url https://api.maxapi.ai/wan/api/v1/services/aigc/text2video/text-to-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "wan2.5-t2v-preview",
"input": {
"prompt": "一只可爱的小猫在草地上玩耍"
}
}
'import requests
url = "https://api.maxapi.ai/wan/api/v1/services/aigc/text2video/text-to-video"
payload = {
"model": "wan2.5-t2v-preview",
"input": { "prompt": "一只可爱的小猫在草地上玩耍" }
}
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: 'wan2.5-t2v-preview', input: {prompt: '一只可爱的小猫在草地上玩耍'}})
};
fetch('https://api.maxapi.ai/wan/api/v1/services/aigc/text2video/text-to-video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maxapi.ai/wan/api/v1/services/aigc/text2video/text-to-video"
payload := strings.NewReader("{\n \"model\": \"wan2.5-t2v-preview\",\n \"input\": {\n \"prompt\": \"一只可爱的小猫在草地上玩耍\"\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.maxapi.ai/wan/api/v1/services/aigc/text2video/text-to-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"wan2.5-t2v-preview\",\n \"input\": {\n \"prompt\": \"一只可爱的小猫在草地上玩耍\"\n }\n}")
.asString();{
"output": {
"task_id": "task_123456",
"task_status": "PENDING"
},
"request_id": "req_123456",
"usage": {
"duration": 5
}
}授权
使用 MiniMax API Key 进行认证
请求头
请求体
application/json
模型名称
可用选项:
wan2.5-i2v-preview, wan2.2-i2v-flash, wan2.2-i2v-plus, wanx2.1-i2v-turbo, wanx2.1-i2v-plus