Tài liệu API

bp-virtual-try-on

Thử Đồ AI — Upload ảnh quần áo + chọn người mẫu → AI mặc đồ lên người. Phù hợp cho shop online, POD sellers.

type: imageoutput: imageTheo 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": "bp-virtual-try-on" 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ả
modelrequiredstringbp-virtual-try-onMã model
garment_urlrequiredstring (URL image)
Ảnh sản phẩm — Upload ảnh quần áo, váy, áo thun... nền trắng/đơn giản cho kết quả tốt nhất.
model_variantrequiredenum
https://sangtaoai.blob.core.windows.net/content/public/assets/blueprints/virtual-try-on/59d3dc9f-aa98-454d-afcb-f5a5a8465242.webphttps://sangtaoai.blob.core.windows.net/content/public/assets/blueprints/virtual-try-on/939814e9-eb90-4846-b5a6-398f713b65c5.webphttps://sangtaoai.blob.core.windows.net/content/public/assets/blueprints/virtual-try-on/96be35e6-2bc4-4a1b-b143-fb8ade2f594e.webphttps://sangtaoai.blob.core.windows.net/content/public/assets/blueprints/virtual-try-on/005a2d2e-56cf-4e3e-8448-6f51b3dc48f1.webphttps://sangtaoai.blob.core.windows.net/content/public/assets/blueprints/virtual-try-on/d1b06f47-470e-4441-8c8d-fb8025eda90a.webphttps://sangtaoai.blob.core.windows.net/content/public/assets/blueprints/virtual-try-on/12b023ad-00b7-4b42-a976-e23f22b3ad41.webphttps://sangtaoai.blob.core.windows.net/content/public/assets/blueprints/virtual-try-on/e26db67e-36c3-4b28-9f08-f58a17eaa9ac.webphttps://sangtaoai.blob.core.windows.net/content/public/assets/blueprints/virtual-try-on/f26c5579-759f-4fb3-82ca-078b5625b25b.webphttps://sangtaoai.blob.core.windows.net/content/public/assets/blueprints/virtual-try-on/d19eddb2-a4ba-4b39-ae43-826fddaef13f.webphttps://sangtaoai.blob.core.windows.net/content/public/assets/blueprints/virtual-try-on/1b809713-a543-481e-80f8-1a2cf9be6b4c.webp

Mặc định: https://sangtaoai.blob.core.windows.net/content/public/assets/blueprints/virtual-try-on/59d3dc9f-aa98-454d-afcb-f5a5a8465242.webp

Người mẫu
scenerequiredenum
choose the most suitable background and setting that complements this clothing itemclean white studio background, professional lightingoutdoor urban street, natural daylight, city backdroptropical beach, golden hour sunlight, ocean backgroundmodern cafe interior, warm ambient lightinglush green park or garden, soft natural light

Mặc định: choose the most suitable background and setting that complements this clothing item

Bối cảnh
aspect_ratiorequiredenum
9:163:41:14:3

Mặc định: 9:16

Tỷ lệ ảnh
nrequiredenum
124

Mặc định: 2

Số lượng ảnh
resolutionrequiredenum
2K4K

Mặc định: 2K

Chất lượng ảnh
extrastring

Tối đa 2.000 ký tự

Yêu cầu thêm
tierrequiredenum
economyfast

Mặc định: economy

Tốc độ xử lý
  • 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://nov.ai.vn/api/v1/generations \
  -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
  -d '{
  "model": "bp-virtual-try-on",
  "garment_url": "https://example.com/image.jpg",
  "model_variant": "https://sangtaoai.blob.core.windows.net/content/public/assets/blueprints/virtual-try-on/59d3dc9f-aa98-454d-afcb-f5a5a8465242.webp",
  "scene": "choose the most suitable background and setting that complements this clothing item",
  "aspect_ratio": "9:16",
  "n": "2",
  "resolution": "2K",
  "tier": "economy"
}'

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": "bp-virtual-try-on",
  "status": "succeeded",       // queued | processing | succeeded | failed | cancelled
  "progress": 100,
  "cost": 2400,                // số tiền đã trừ
  "currency": "VND",
  "refunded": false,
  "output": {
    "type": "image",
    "files": [{ "url": "https://nov.ai.vn/uploads/ai/outputs/....png", "type": "image", "name": "image.png" }],
    "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": "bp-virtual-try-on", "cost": 2400, "currency": "VND" }
Lấy API key
bp-virtual-try-on · Tài liệu API | NOV AI