Tạo tác vụ tạo video

post/v1/video/generations

Gửi một tác vụ tạo video. Hỗ trợ cả text-to-video và image-to-video.

Trả về ID tác vụ để bạn có thể thăm dò trạng thái qua endpoint GET.

Xác thực

Gửi khóa API OLETOKEN dưới dạng token Bearer. Khóa được tạo tại trang API Keys trong bảng điều khiển.

Authorization: Bearer $OLETOKEN_API_KEY

Nội dung yêu cầu

Content-Type:application/json

TrườngKiểuBắt buộcMô tả
modelstring—ID mô hình hoặc kiểu
promptstring—Prompt văn bản
imagestring—Đầu vào hình ảnh (URL hoặc Base64)
durationnumber—Thời lượng video tính bằng giây
widthinteger—Chiều rộng video
heightinteger—Chiều cao video
fpsinteger—Tốc độ khung hình của video
seedinteger—Seed ngẫu nhiên
ninteger—Số lượng video cần tạo
response_formatstring—Định dạng phản hồi
userstring—Mã định danh người dùng
metadataobject—Tham số bổ sung (như negative_prompt, style, quality_level)

Phản hồi

200Đã tạo tác vụ tạo video

TrườngKiểuBắt buộcMô tả
task_idstring—ID tác vụ
statusstring—Trạng thái tác vụ

400Tham số yêu cầu không hợp lệ

TrườngKiểuBắt buộcMô tả
errorobject——
messagestring—Thông báo lỗi
typestring—Loại lỗi
paramstring | null—Tham số liên quan
codestring | null—Mã lỗi

Ví dụ yêu cầu

curl -X POST 'https://api.oletoken.ai/v1/video/generations' \
  -H "Authorization: Bearer $OLETOKEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "kling-v1",
    "prompt": "宇航员在月球上漫步",
    "duration": 5,
    "width": 1280,
    "height": 720
  }'