Skip to main content
POST
Tạo video Flux 3 từ văn bản, hình ảnh tham chiếu hoặc khung hình đầu và cuối. Lưu id được trả về để thăm dò tác vụ và tải video đã hoàn tất xuống. POST /v1/videos sử dụng multipart/form-data. Gửi các tùy chọn điều khiển dưới dạng trường biểu mẫu. Đối với dữ liệu đầu vào hình ảnh, hãy dùng URL hình ảnh tham chiếu hoặc khung hình mở đầu và kết thúc. Giữ input_reference tách biệt với first_framelast_frame.

Chọn chế độ đầu vào

Sử dụng hình ảnh tham chiếu

Trường input_reference chỉ chấp nhận các URL hình ảnh HTTPS có thể truy cập công khai. Gửi trường này một lần cho một hình ảnh hoặc lặp lại theo thứ tự keyframe cho nhiều hình ảnh. Dùng một URL cho mỗi trường, tối đa 10 URL. Mô tả chuyển động, hành vi của camera và các chi tiết trực quan mà video được tạo cần giữ lại từ hình ảnh tham chiếu. Các mẫu yêu cầu ở đầu trang này minh họa dữ liệu đầu vào một hình ảnh và nhiều hình ảnh. Yêu cầu sau đây sử dụng hai hình ảnh theo thứ tự đã gửi:

Đặt khung hình đầu và cuối

Gửi first_frame để đặt hình ảnh mở đầu. Để đồng thời đặt hình ảnh kết thúc, hãy thêm last_frame và mô tả chuyển động giữa hai khung hình trong prompt. Đối với chỉ khung hình mở đầu, hãy bỏ qua last_frame. Khung hình kết thúc yêu cầu cả first_framelast_frame. Mỗi trường chấp nhận một URL HTTPS có thể truy cập công khai hoặc một tệp PNG hoặc JPEG. Gửi mỗi trường một lần, bằng URL hoặc tệp. Giữ mỗi tệp ở mức không quá 20 MiB (20 × 1024 × 1024 byte). Các ví dụ về khung hình ở đầu trang này minh họa dữ liệu đầu vào bằng URL và tải tệp lên, với secondssize được đặt tường minh.

Đặt thời lượng và kích thước

Đặt seconds một cách tường minh thành số nguyên từ 5 đến 20. Đặt size thành một trong các giá trị preset WxH chính xác sau đây: Giá trị kích thước chọn cấp độ độ phân giải đầu ra. Đối với video từ văn bản, kích thước được mã hóa có thể được điều chỉnh để căn chỉnh codec. Đối với video từ hình ảnh, hình ảnh tham chiếu cũng có thể xác định khung hình và tỷ lệ khung hình cuối cùng.

Luồng tác vụ

1

Tạo tác vụ

Gửi yêu cầu biểu mẫu multipart và lưu id được trả về.
2

Thăm dò tác vụ

Gọi Truy xuất video Flux 3 cho đến khi statuscompleted hoặc failed.
3

Tải kết quả xuống

Khi tác vụ ở trạng thái completed, hãy gọi Tải nội dung video Flux 3 xuống để lưu tệp MP4.

Ủy quyền

Authorization
string
header
bắt buộc

Bearer authentication. Use your CometAPI API key.

Nội dung

multipart/form-data

Flux 3 multipart request. Choose text, input_reference URLs, or first_frame and last_frame inputs. Keep reference-image and frame inputs separate.

model
string
mặc định:flux-3
bắt buộc

Model ID for this route. Use flux-3.

Allowed value: "flux-3"
prompt
string
mặc định:A paper boat glides across a still pond while the camera moves forward.
bắt buộc

Text that describes the scene, motion, camera behavior, and visual details that the video should preserve.

Minimum string length: 1
seconds
integer

Requested clip duration in whole seconds. Set seconds explicitly to an integer from 5 through 20.

Phạm vi bắt buộc: 5 <= x <= 20
size
enum<string>
mặc định:1280x720

Resolution preset in exact WxH form. Use 1280x720 for the 720p tier or 1920x1080 for the 1080p tier. Encoded dimensions can be codec-aligned; image-to-video framing can follow the reference image.

Tùy chọn có sẵn:
1280x720,
1920x1080
input_reference

Reference image URLs. Send one publicly accessible HTTPS image URL per input_reference field. For multiple images, repeat the field in keyframe order, up to 10 URLs. This field accepts URLs only. Keep it separate from first_frame and last_frame.

Pattern: ^https://
first_frame

Opening-frame image as one publicly accessible HTTPS URL or one PNG or JPEG file. Keep each file at or below 20 MiB (20 × 1024 × 1024 bytes). Send the field once, using either a URL or a file. Pair with last_frame to set both boundaries. Keep frame inputs separate from input_reference.

Pattern: ^https://
last_frame

Closing-frame image as one publicly accessible HTTPS URL or one PNG or JPEG file. Keep each file at or below 20 MiB (20 × 1024 × 1024 bytes). Send the field once, using either a URL or a file. To specify the closing image through this endpoint, send last_frame together with first_frame. Keep frame inputs separate from input_reference.

Pattern: ^https://

Phản hồi

Task created. Store the returned id and poll GET /v1/videos/{task_id}.

id
string
bắt buộc

Task ID. Use this value as task_id in retrieve and content requests.

Ví dụ:

"<task_id>"

object
string
bắt buộc

Object type for the asynchronous video task.

Allowed value: "video"
model
string
bắt buộc

Model ID that the task uses.

Allowed value: "flux-3"
status
enum<string>
bắt buộc

Task lifecycle status. Poll until the value is completed or failed.

Tùy chọn có sẵn:
queued,
in_progress,
completed,
failed
progress
integer
bắt buộc

Task progress as a coarse percentage.

Phạm vi bắt buộc: 0 <= x <= 100
created_at
integer<int64>
bắt buộc

Task creation time as a Unix timestamp in seconds.

task_id
string

Compatibility alias for id. This field can be omitted from retrieve responses.

Ví dụ:

"<task_id>"

completed_at
integer<int64>

Task completion time as a Unix timestamp in seconds when the task provides one.

expires_at
integer<int64>

Result expiration time as a Unix timestamp in seconds when the task provides one.

video_url
string<uri>

Video delivery URL. This field appears on completed tasks.

Ví dụ:

"https://media.example.com/flux-3-result.mp4"

error
object

Failure details. This field appears when the task fails.

Lần sửa đổi cuối 9 tháng 9, 2026