tool-ban-hang
Product review video — Upload product photos — AI automatically analyzes, creates authentic Vietnamese scenes, and exports a 15-second 1080p sales review video, with or without voiceover (Northern / Southern accent).
tool-ban-hangGET /api/v1/models/tool-ban-hang/serversBảng giá API chi tiết theo từng cấu hình tham số
Đơn giá thực tế (VNĐ) trừ vào ví khi gọi POST /v1/generations (hoặc kiểm tra trước qua POST /v1/generations/estimate).
Input — request parameters
/v1/generationsGửi JSON theo cấu trúc chuẩn "model": "tool-ban-hang", "server": "sv1" and the parameters below at the same level. Parameters not listed in the table are rejected (400).
| Parameter | Type | Supported values | Description |
|---|---|---|---|
modelrequired | string | tool-ban-hang | Mã gói sản phẩm trực tiếp hoặc mã dòng model chuẩn (kết hợp cùng tham số chọn SV bên dưới). |
server | string | sv1auto | Chốt máy chủ SV chạy đơn (cũng nhận alias server_id) hoặc auto để tự chọn SV healthy giá tốt nhất. Kiểm tra SV sống qua GET /v1/models/tool-ban-hang/servers. |
image_urlrequired | string (URL image) | Original product photo | |
character_image_url | string (URL image) | Character reference image (Optional) | |
tbh_product_namerequired | string | Up to 2.000 characters | Product name |
tbh_genderrequired | enum | NữNam Default: | Reviewer character |
tbh_agerequired | integer | 16 – 70 Default: | Character age |
tbh_contextrequired | enum | Trong nhà Việt Nam (phòng khách bình dị, bàn trà gỗ, ánh sáng tự nhiên)Ngoài sân nhà Việt Nam (sân gạch/xi măng, chậu cây cảnh, nắng tự nhiên)Trong phân xưởng sản xuất sạch sẽ tại Việt Nam, có máy móc và kệ hàng phía sau, ánh sáng chân thậtGóc review chuyên nghiệp tại Việt Nam, bàn setup gọn gàng, đèn mềm, phông nền hiện đạiQuán cà phê vỉa hè / bàn gỗ Việt Nam buổi sángGóc bàn học / bàn làm việc phòng ngủ Việt Namcustom Default: | Authentic Vietnamese setting |
tbh_context_text | string | Up to 2.000 characters | Custom setting Only applies when |
tbh_stylerequired | enum | voicebroll Default: | Shooting style |
tbh_accent | enum | northsouth Default: | Voice Only applies when |
tbh_shot_typerequired | enum | oneshotbroll Default: | Shooting style |
tbh_product_desc | string | Detailed product description (Optional) | |
tbh_custom_dialogue | string | Custom script (Optional — leave blank for AI to write) | |
upscale4k | enum | goc4k Default: | Độ phân giải — Chọn 4K: model chạy ở độ phân giải cao nhất, video xong tự làm nét lên 4K (thêm vài phút); giá = giá model ở mức cao nhất + giá Làm nét video 4K. Nếu bước nâng 4K lỗi sẽ hoàn lại phần tiền 4K và vẫn giao video gốc. |
- File parameters (string URL) accept a public http(s) link — the server downloads it — or a URL returned by the file upload API POST /account/ai/uploads.
- Bỏ trống tham số không bắt buộc thì dùng giá trị mặc định. Có thể gửi thêm header Idempotency-Key để thử lại an toàn không trừ tiền 2 lần.
Sample request (cURL)
curl -X POST https://promptflow.web.id/api/v1/generations \
-H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
-d '{
"model": "tool-ban-hang",
"server": "sv1",
"image_url": "https://example.com/image.jpg",
"tbh_product_name": "...",
"tbh_gender": "Nữ",
"tbh_age": 25,
"tbh_context": "Trong nhà Việt Nam (phòng khách bình dị, bàn trà gỗ, ánh sáng tự nhiên)",
"tbh_style": "voice",
"tbh_shot_type": "oneshot",
"upscale4k": "goc"
}'Complete integration code sample (Upload file → Create job → Poll result)
Python 3
import os, time, requests
BASE = "https://promptflow.web.id/api"
API_KEY = os.environ["API_KEY"]
HEADERS = {"X-API-Key": API_KEY}
with open("./input.jpg", "rb") as f:
up_res = requests.post(f"{BASE}/account/ai/uploads", headers=HEADERS, files={"file": f}, timeout=120)
up = up_res.json()
if not up_res.ok:
raise RuntimeError(up.get("message") or up_res.text)
payload = {
"model": "tool-ban-hang",
"server": "sv1",
"tbh_product_name": "...",
"tbh_gender": "Nữ",
"tbh_age": 25,
"tbh_context": "Trong nhà Việt Nam (phòng khách bình dị, bàn trà gỗ, ánh sáng tự nhiên)",
"tbh_style": "voice",
"tbh_shot_type": "oneshot",
"upscale4k": "goc"
}
payload["image_url"] = up["url"]
r = requests.post(f"{BASE}/v1/generations", headers=HEADERS, json=payload, timeout=60)
gen = r.json()
if not r.ok:
raise RuntimeError(gen.get("message") or r.text)
while gen.get("status") in ("queued", "processing"):
time.sleep(5)
gen = requests.get(f"{BASE}/v1/generations/{gen['id']}", headers=HEADERS, timeout=60).json()
if gen.get("status") != "succeeded":
raise RuntimeError(gen.get("error") or gen.get("status"))
print("Kết quả:", [f["url"] for f in gen["output"]["files"]])Node.js (18+)
import fs from "node:fs";
import path from "node:path";
const BASE = "https://promptflow.web.id/api";
const API_KEY = process.env.API_KEY; // lấy tại trang /api-keys
// Bước 1: Upload file đầu vào từ máy lên server (hoặc dùng thẳng link https công khai)
const form = new FormData();
form.append("file", new Blob([fs.readFileSync("./input.jpg")]), path.basename("./input.jpg"));
const upRes = await fetch(`${BASE}/account/ai/uploads`, {
method: "POST",
headers: { "X-API-Key": API_KEY },
body: form,
});
const up = await upRes.json();
if (!upRes.ok) throw new Error(up.message || upRes.statusText);
// Bước 2: Gửi tạo tác vụ kèm URL file vừa tải lên
const createRes = await fetch(`${BASE}/v1/generations`, {
method: "POST",
headers: { "X-API-Key": API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
...{
"model": "tool-ban-hang",
"server": "sv1",
"tbh_product_name": "...",
"tbh_gender": "Nữ",
"tbh_age": 25,
"tbh_context": "Trong nhà Việt Nam (phòng khách bình dị, bàn trà gỗ, ánh sáng tự nhiên)",
"tbh_style": "voice",
"tbh_shot_type": "oneshot",
"upscale4k": "goc"
},
image_url: up.url,
}),
});
let gen = await createRes.json();
if (!createRes.ok) throw new Error(gen.message || createRes.statusText);
// Bước 3: Chờ kết quả
while (["queued", "processing"].includes(gen.status)) {
await new Promise((r) => setTimeout(r, 5000));
gen = await fetch(`${BASE}/v1/generations/${gen.id}`, { headers: { "X-API-Key": API_KEY } }).then((r) => r.json());
}
if (gen.status !== "succeeded") throw new Error(gen.error ?? gen.status);
console.log("Kết quả:", gen.output.files.map((f) => f.url));Output — response
Jobs run asynchronously. POST /v1/generations immediately returns a generation object with status queued or processing; poll GET /v1/generations/{id} every 5–10 seconds until status is succeeded, failed or cancelled.
/v1/generations/{id}{
"id": "3f1c...-uuid",
"object": "generation",
"code": "T8KQ2M4X",
"model": "tool-ban-hang",
"canonical_model": "tool-ban-hang",
"server_id": "sv1",
"server_name": "SV1",
"status": "succeeded", // queued | processing | succeeded | failed | cancelled
"progress": 100,
"cost": 2400, // amount charged
"currency": "VND",
"refunded": false,
"output": {
"type": "video",
"files": [{ "url": "https://promptflow.web.id/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"
}| Field | Meaning |
|---|---|
| model / server_id | Đúng mã gói sản phẩm và máy chủ SV đã thực thi tác vụ. |
| output.files[].url | Result file links — download them to your own system; files on our server may be cleaned up after some time. |
| output.text | Text content (only for models that return text). |
| cost | Amount in VND charged to your balance; refunded automatically on failure or cancellation (refunded = true). |
| error | Error reason when status = failed. |
Get a quote before running
/v1/generations/estimateCùng body với POST /v1/generations, không chạy và không trừ tiền (tự áp % chiết khấu riêng nếu tài khoản có).
# => {
# "object": "estimate",
# "model": "tool-ban-hang",
# "canonical_model": "tool-ban-hang",
# "server_id": "sv1",
# "server_name": "SV1",
# "cost": 2400,
# "currency": "VND"
# }