Tài liệu API

motion-v2

Motion control V2 - Trên 10s — Nhân vật trong ảnh chuyển động theo video mẫu, chuyển động ổn định, ít lỗi; chọn chất lượng Low / High, 10 hoặc 15 giây.

type: textoutput: videoTheo tham số — dùng POST /v1/generations/estimate để báo giá

Input — tham số đầu vào

POST/v1/generations

Gửi JSON gồm "model": "motion-v2" và các tham số dưới đây ở cùng cấp. Tham số không có trong bảng sẽ bị từ chối (400).

Tham sốKiểuGiá trị hỗ trợMô tả
modelrequiredstringmotion-v2Mã model
image_urlrequiredstring (URL image)
Ảnh nhân vật — JPG, PNG, WebP · tối đa 10 MB
video_urlrequiredstring (URL video)
Video chuyển động mẫu — MP4 · tối đa 30 MB
qualityrequiredenum
lowhigh

Mặc định: low

Chất lượng
durationrequiredenum
1015

Mặc định: 10

Thời lượng
orientationenum
follow_characterfollow_motion

Mặc định: follow_character

Hướng nhân vật
keep_audioboolean

true, false

Mặc định: true

Giữ âm thanh gốc
  • Tham số file (string URL) nhận link công khai http(s) — máy chủ tự tải về — hoặc URL trả về từ API tải file POST /account/ai/uploads.
  • Bỏ trống tham số không bắt buộc thì dùng giá trị mặc định.

Ví dụ request

curl -X POST https://thu.nov.ai.vn/api/v1/generations \
  -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
  -d '{
  "model": "motion-v2",
  "image_url": "https://example.com/image.jpg",
  "video_url": "https://example.com/video.mp4",
  "quality": "low",
  "duration": "10",
  "orientation": "follow_character",
  "keep_audio": true
}'

Output — kết quả trả về

Tác vụ chạy bất đồng bộ. POST /v1/generations trả ngay đối tượng generation với status queued hoặc processing; hỏi lại GET /v1/generations/{id} mỗi 5–10 giây tới khi status là succeeded, failed hoặc cancelled.

GET/v1/generations/{id}
{
  "id": "3f1c...-uuid",
  "object": "generation",
  "code": "T8KQ2M4X",
  "model": "motion-v2",
  "status": "succeeded",       // queued | processing | succeeded | failed | cancelled
  "progress": 100,
  "cost": 2400,                // số tiền đã trừ
  "currency": "VND",
  "refunded": false,
  "output": {
    "type": "video",
    "files": [{ "url": "https://thu.nov.ai.vn/uploads/ai/outputs/....mp4", "type": "video", "name": "video.mp4" }],
    "text": null
  },
  "error": null,
  "created_at": "2026-10-30T08:00:00.000Z",
  "completed_at": "2026-10-30T08:01:12.000Z"
}
TrườngÝ nghĩa
output.files[].urlLink file kết quả — nên tải về hệ thống của bạn, file trên máy chủ có thể được dọn sau một thời gian.
output.textNội dung văn bản (chỉ có với model trả văn bản).
costSố tiền VND đã trừ vào số dư; lỗi hoặc huỷ thì tự hoàn lại (refunded = true).
errorLý do lỗi khi status = failed.

Báo giá trước khi chạy

POST/v1/generations/estimate

Cùng body với POST /v1/generations, không chạy và không trừ tiền.

# => { "object": "estimate", "model": "motion-v2", "cost": 2400, "currency": "VND" }
Lấy API key