FLUX 3 API
เอกสารอ้างอิง API ฉบับสมบูรณ์สำหรับโมเดลสร้างวิดีโอ FLUX 3 ทุกรุ่นใช้ endpoint งานวิดีโอแบบรวม
รุ่นโมเดล {#}
การเปรียบเทียบโดยย่อ
ทั้งสี่โมเดลรองรับอัตราส่วนภาพต่อไปนี้:
21:9, 2:1, 16:9, 4:3, 1:1, 3:4, 9:16
Endpoint
POST /api/v1/video/task
การยืนยันตัวตน
Authorization: Bearer YOUR_API_KEY
FLUX 3 Text to Video
พารามิเตอร์คำขอ
จำเป็น
เลือกใช้ได้
ตัวอย่างคำขอ
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
พารามิเตอร์คำขอ
จำเป็น
เลือกใช้ได้
ตัวอย่างคำขอ
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
พารามิเตอร์คำขอ
จำเป็น
เลือกใช้ได้
ตัวอย่างคำขอ
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
วิดีโออินพุตต้องเป็นรูปแบบ 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