FLUX 3 API
FLUX 3 影片生成模型的完整 API 參考。所有變體均使用統一的影片任務端點。
模型變體
快速比較
所有四種模型均支援以下長寬比:
21:9、2:1、16:9、4:3、1:1、3:4、9:16
端點
POST /api/v1/video/task
驗證
Authorization: Bearer YOUR_API_KEY
FLUX 3 文字生成影片
請求參數
必填
選填
請求範例
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'flux-3.0-text-to-video',
prompt: 'A cinematic aerial shot of a coastal city at sunrise',
resolution: '1080p',
aspect_ratio: '16:9',
duration: 10,
sound: true,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
FLUX 3 影像生成影片
請求參數
必填
選填
請求範例
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'flux-3.0-image-to-video',
prompt: 'A gentle camera push forward with natural subject motion',
resolution: '1080p',
aspect_ratio: '16:9',
image_url: 'https://example.com/first-frame.jpg',
duration: 10,
sound: true,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
FLUX 3 首尾幀生成影片
請求參數
必填
選填
請求範例
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'flux-3.0-start-end-to-video',
prompt: 'Create a smooth cinematic transition with consistent lighting',
resolution: '720p',
aspect_ratio: '16:9',
image_url: 'https://example.com/start-frame.jpg',
image_end_url: 'https://example.com/end-frame.jpg',
duration: 8,
sound: true,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
FLUX 3 影片延長
輸入影片必須使用 MP4 格式,時長不得超過 15 秒,且大小不得超過 50 MB。
請求參數
必填
選填
請求範例
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'flux-3.0-video-extend',
prompt: 'Continue the scene as the subject walks toward the skyline',
resolution: '1080p',
aspect_ratio: '16:9',
video_url: 'https://example.com/source-video.mp4',
duration: 10,
sound: true,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
回應格式
初始回應
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
輪詢回應
輪詢 GET /api/v1/video/{task_id} 以檢查任務狀態:
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"task_result": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
狀態值
submitted:任務已接受
processing:正在生成影片
succeed:影片生成成功完成
failed:影片生成失敗
最佳實務
- 長寬比:提交任務前,請選擇適合目標頻道的長寬比。
- 時長:所有變體均需使用 5 至 20 秒之間的值。
- 輸入媒體:請使用可存取的影像 URL,以及符合影片延長限制的 MP4 來源影片。
- 輪詢:每隔 5–10 秒輪詢一次,直到
task_status 變為 succeed 或 failed。