API Pixverse C1
Tài liệu tham chiếu API đầy đủ cho các mô hình tạo video Pixverse C1. Tất cả biến thể đều dùng endpoint tác vụ video thống nhất.
Biến thể mô hình
So sánh nhanh
Các mô hình text-to-video hỗ trợ tỷ lệ khung hình: 21:9, 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3.
Pixverse C1 Text to Video
Endpoint
POST /api/v1/video/task
Tham số yêu cầu
Bắt buộc
Tùy chọn
Ví dụ yêu cầ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: 'pixverse-c1-text-to-video',
prompt: 'A drone shot over coastline at golden hour',
duration: 5,
resolution: '720p',
aspect_ratio: '16:9',
sound: true,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Pixverse C1 Image to Video
Tham số yêu cầu
Bắt buộc
Tùy chọn
Ví dụ yêu cầ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: 'pixverse-c1-image-to-video',
prompt: 'Slow zoom in; soft natural motion',
duration: 5,
resolution: '720p',
image_url: 'https://example.com/first-frame.jpg',
sound: false,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Pixverse C1 Transition
Tạo chuyển động giữa ảnh keyframe đầu tiên và cuối cùng.
Tham số yêu cầu
Bắt buộc
Tùy chọn
Ví dụ yêu cầ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: 'pixverse-c1-transition',
prompt: 'Smooth cinematic morph between the two scenes',
duration: 6,
resolution: '720p',
image_url: 'https://example.com/start.jpg',
image_end_url: 'https://example.com/end.jpg',
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 polling
Poll GET /api/v1/video/{taskId} để kiểm tra trạng thái:
{
"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"
}
]
}
}
}
Giá trị trạng thái
submitted: Tác vụ đã được chấp nhận và đang chờ xử lý
processing: Đang tạo video
succeed: Tạo video đã hoàn tất
failed: Tạo video thất bại
Thực hành tốt nhất
- Độ phân giải: Dùng
720p hoặc 1080p để cân bằng chất lượng và thời gian tạo; dùng 360p hoặc 540p để lặp nhanh hơn.
- Chuyển tiếp: Dùng khung đầu và khung cuối sắc nét, đủ sáng để mô hình có thể nội suy chuyển động đáng tin cậy.
- Âm thanh: Đặt
sound khi bạn muốn âm thanh môi trường được đồng bộ; bỏ qua hoặc đặt false cho đầu ra im lặng.
- Polling: Poll mỗi 5–10 giây cho đến khi
task_status là succeed hoặc failed.