import requests
url = "https://api.scenext.cn/api/gen_video"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"question": "什么是傅里叶级数",
"answer": "",
"questionImages": [],
"answerImages": [],
"quality": "m",
"notify_url": "https://your-domain.com/webhook"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = "https://api.scenext.cn/api/gen_video";
const headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
};
const data = {
question: "什么是傅里叶级数",
answer: "",
questionImages: [],
answerImages: [],
quality: "m",
notify_url: "https://your-domain.com/webhook"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data));
curl -X POST https://api.scenext.cn/api/gen_video \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "什么是傅里叶级数",
"answer": "",
"questionImages": [],
"answerImages": [],
"quality": "m",
"notify_url": "https://your-domain.com/webhook"
}'
{
"status": "success",
"data": {
"task_id": "12345"
}
}
{
"status": "error",
"data": {
"messages": "The video generation interface response is abnormal: 400 - Bad Request"
}
}
API 接口
生成视频
创建视频生成任务
POST
/
api
/
gen_video
import requests
url = "https://api.scenext.cn/api/gen_video"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"question": "什么是傅里叶级数",
"answer": "",
"questionImages": [],
"answerImages": [],
"quality": "m",
"notify_url": "https://your-domain.com/webhook"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = "https://api.scenext.cn/api/gen_video";
const headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
};
const data = {
question: "什么是傅里叶级数",
answer: "",
questionImages: [],
answerImages: [],
quality: "m",
notify_url: "https://your-domain.com/webhook"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data));
curl -X POST https://api.scenext.cn/api/gen_video \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "什么是傅里叶级数",
"answer": "",
"questionImages": [],
"answerImages": [],
"quality": "m",
"notify_url": "https://your-domain.com/webhook"
}'
{
"status": "success",
"data": {
"task_id": "12345"
}
}
{
"status": "error",
"data": {
"messages": "The video generation interface response is abnormal: 400 - Bad Request"
}
}
生成视频
此API用于创建视频生成任务。请求
请求头
string
必填
API密钥认证,格式:
Bearer YOUR_API_KEY请求参数
question和questionImages中至少输入一个。string
必填
问题内容(文本形式)
array
问题内容(图片形式),输入图片的URL或者base64
string
参考答案(文本形式):确保生成的讲解内容准确
array
参考答案(图片形式),输入图片的URL或者base64
string
默认值:"m"
视频质量等级:
h: 高质量m: 中等质量(默认)l: 低质量
string
任务完成时的回调地址(可选),包含http的完整URL
响应
string
请求状态:
success 或 error示例
import requests
url = "https://api.scenext.cn/api/gen_video"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"question": "什么是傅里叶级数",
"answer": "",
"questionImages": [],
"answerImages": [],
"quality": "m",
"notify_url": "https://your-domain.com/webhook"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = "https://api.scenext.cn/api/gen_video";
const headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
};
const data = {
question: "什么是傅里叶级数",
answer: "",
questionImages: [],
answerImages: [],
quality: "m",
notify_url: "https://your-domain.com/webhook"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data));
curl -X POST https://api.scenext.cn/api/gen_video \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "什么是傅里叶级数",
"answer": "",
"questionImages": [],
"answerImages": [],
"quality": "m",
"notify_url": "https://your-domain.com/webhook"
}'
{
"status": "success",
"data": {
"task_id": "12345"
}
}
{
"status": "error",
"data": {
"messages": "The video generation interface response is abnormal: 400 - Bad Request"
}
}
注意事项
- 视频生成是异步过程,可能需要几分钟到几十分钟不等
- 请使用返回的
task_id查询任务状态 - 如果提供了
notify_url,任务完成时会发送回调通知
⌘I