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。