创建视频任务
curl --request POST \
--url https://api.heizhu.lol/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "L-stable-seedance-2-0-933-720p",
"prompt": "电影感近景,人物在雨夜街道缓慢回头,镜头平稳推进",
"duration": 1,
"video_duration": 15
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'L-stable-seedance-2-0-933-720p',
prompt: '电影感近景,人物在雨夜街道缓慢回头,镜头平稳推进',
duration: 1,
video_duration: 15
})
};
fetch('https://api.heizhu.lol/v1/videos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.heizhu.lol/v1/videos"
payload = {
"model": "L-stable-seedance-2-0-933-720p",
"prompt": "电影感近景,人物在雨夜街道缓慢回头,镜头平稳推进",
"duration": 1,
"video_duration": 15
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "task_xxxxxxxxxx",
"object": "video",
"model": "L-stable-seedance-2-0-933-720p",
"status": "queued",
"progress": 0,
"created_at": 1788480000
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"success": true
}建立影片任務
提交文字或參考素材,建立非同步影片生成任務。
POST
https://api.heizhu.lol
/
v1
/
videos
创建视频任务
curl --request POST \
--url https://api.heizhu.lol/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "L-stable-seedance-2-0-933-720p",
"prompt": "电影感近景,人物在雨夜街道缓慢回头,镜头平稳推进",
"duration": 1,
"video_duration": 15
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'L-stable-seedance-2-0-933-720p',
prompt: '电影感近景,人物在雨夜街道缓慢回头,镜头平稳推进',
duration: 1,
video_duration: 15
})
};
fetch('https://api.heizhu.lol/v1/videos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.heizhu.lol/v1/videos"
payload = {
"model": "L-stable-seedance-2-0-933-720p",
"prompt": "电影感近景,人物在雨夜街道缓慢回头,镜头平稳推进",
"duration": 1,
"video_duration": 15
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "task_xxxxxxxxxx",
"object": "video",
"model": "L-stable-seedance-2-0-933-720p",
"status": "queued",
"progress": 0,
"created_at": 1788480000
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"success": true
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"success": true
}建立一個非同步影片生成任務。介面接受 JSON 請求,並在成功提交後返回任務 ID。
請求引數
string
必填
模型廣場中的完整模型名稱。
string
必填
影片生成提示詞。建議明確描述主體、動作、鏡頭、場景和期望風格。
integer
必填
計費與呼叫時長引數。按次模型傳
1;按秒模型傳實際秒數,並與 video_duration 保持一致。integer
必填
目標影片秒數。必須符合所選模型在模型廣場中標註的支援範圍。
string
畫面比例。標準值包括
16:9、9:16、4:3、3:4 和 1:1,具體支援情況由模型決定。string
輸出解析度。可使用
480p、720p 或 1080p;未顯式提供時,部分模型可從模型名稱推斷。string[]
公網可訪問的參考圖片 URL 陣列。
string[]
公網可訪問的參考音訊 URL 陣列。
string[]
公網可訪問的參考影片 URL 陣列。
請求示例
curl https://api.heizhu.lol/v1/videos \
-H "Authorization: Bearer $BLACKPIG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "L-stable-seedance-2-0-933-720p",
"prompt": "电影感近景,人物在雨夜街道缓慢回头,镜头平稳推进",
"duration": 1,
"video_duration": 15,
"aspect_ratio": "9:16",
"resolution": "720p",
"image_urls": ["https://example.com/reference.jpg"]
}'
const response = await fetch('https://api.heizhu.lol/v1/videos', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.BLACKPIG_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'L-stable-seedance-2-0-933-720p',
prompt: '电影感近景,人物在雨夜街道缓慢回头,镜头平稳推进',
duration: 1,
video_duration: 15,
aspect_ratio: '9:16',
resolution: '720p',
image_urls: ['https://example.com/reference.jpg'],
}),
});
const task = await response.json();
import os
import requests
response = requests.post(
"https://api.heizhu.lol/v1/videos",
headers={"Authorization": f"Bearer {os.environ['BLACKPIG_API_KEY']}"},
json={
"model": "L-stable-seedance-2-0-933-720p",
"prompt": "电影感近景,人物在雨夜街道缓慢回头,镜头平稳推进",
"duration": 1,
"video_duration": 15,
"aspect_ratio": "9:16",
"resolution": "720p",
"image_urls": ["https://example.com/reference.jpg"],
},
timeout=60,
)
response.raise_for_status()
task = response.json()
成功響應
string
必填
平臺任務 ID。後續查詢和獲取結果時必須使用此值。
string
必填
物件型別,固定為
video。string
必填
本次任務使用的模型。
string
必填
初始狀態通常為
queued。integer
必填
當前進度百分比。
integer
必填
Unix 時間戳。
{
"id": "task_xxxxxxxxxx",
"object": "video",
"model": "L-stable-seedance-2-0-933-720p",
"status": "queued",
"progress": 0,
"created_at": 1788480000
}
同一次業務操作只應建立一個任務。客戶端超時或查詢失敗不代表任務未建立,請結合服務端響應與業務日誌判斷,避免重複計費。
授權
在控制台创建的黑猪AI API Token。
主體
application/json
模型广场中的完整模型名称。
範例:
"L-stable-seedance-2-0-933-720p"
视频生成提示词。
Minimum string length:
1按次模型传 1;按秒模型传实际秒数。
必填範圍:
x >= 1目标视频秒数,必须符合模型支持范围。
必填範圍:
x >= 1目标画面比例。
可用選項:
16:9, 9:16, 4:3, 3:4, 1:1 目标输出分辨率。
可用選項:
480p, 720p, 1080p 公网参考图片 URL。
Pattern:
^https?://公网参考音频 URL。
Pattern:
^https?://公网参考视频 URL。
Pattern:
^https?://回應
任务创建成功
平台任务 ID。
Allowed value:
"video"任务使用的模型。
可用選項:
queued, in_progress, completed, failed, unknown 必填範圍:
0 <= x <= 100创建时间的 Unix 时间戳。
任务结束时间的 Unix 时间戳。
Show child attributes
Show child attributes
