FLUX 3 API
Tài liệu tham khảo API đầy đủ cho các mô hình tạo video FLUX 3. Tất cả biến thể đều sử dụng endpoint tác vụ video hợp nhất.
Các biến thể mô hình
So sánh nhanh
Cả bốn mô hình đều hỗ trợ các tỷ lệ khung hình sau:
21:9, 2:1, 16:9, 4:3, 1:1, 3:4, 9:16
Endpoint
POST /api/v1/video/task
Xác thực
Authorization: Bearer YOUR_API_KEY
FLUX 3 Text to Video
Tham số yêu cầu
Bắt buộc
Tùy chọn
Yêu cầu mẫu
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 Image to Video
Tham số yêu cầu
Bắt buộc
Tùy chọn
Yêu cầu mẫu
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 Start-End to Video
Tham số yêu cầu
Bắt buộc
Tùy chọn
Yêu cầu mẫu
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 Video Extend
Video đầu vào phải ở định dạng MP4, dài không quá 15 giây và có dung lượng không quá 50 MB.
Tham số yêu cầu
Bắt buộc
Tùy chọn
Yêu cầu mẫu
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;
Định dạng phản hồi
Phản hồi ban đầu
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
Phản hồi thăm dò
Thăm dò GET /api/v1/video/{task_id} để kiểm tra trạng thái tác vụ:
{
"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"
}
]
}
}
}
Các giá trị trạng thái
submitted: Tác vụ đã được chấp nhận
processing: Đang tạo video
succeed: Tạo video thành công
failed: Tạo video thất bại
Phương pháp hay nhất
- Tỷ lệ khung hình: Chọn tỷ lệ cho kênh đích trước khi gửi tác vụ.
- Thời lượng: Sử dụng giá trị từ 5 đến 20 giây cho mọi biến thể.
- Phương tiện đầu vào: Sử dụng URL hình ảnh có thể truy cập và nguồn MP4 nằm trong giới hạn mở rộng video.
- Thăm dò: Thăm dò mỗi 5–10 giây cho đến khi
task_status là succeed hoặc failed.