Models
GET
https://sangtao.ai/api/v2/modelsTài liệu cho Models.
Danh sách model AI. Mỗi model có config object theo key định nghĩa form fields — render động thay vì hardcode.
Tham số query
| Field | Type | Description |
|---|---|---|
| category | string | Lọc theo category: "image", "video", v.v. |
cURL
bash
curl "https://sangtao.ai/api/v2/models?category=image" \\
-H "X-Api-Key: YOUR_API_KEY"Các field response
| Field | Type | Description |
|---|---|---|
| slug* | string | ID duy nhất — dùng làm param model trong endpoint tạo nội dung |
| displayName* | string | Tên hiển thị |
| category* | string | Category viết thường (xem bảng bên dưới) |
| creditCost* | number | Chi phí credit cơ bản mỗi lần tạo |
| description | string | Mô tả model (nullable) |
| imageUrl | string | Ảnh preview model (nullable) |
| config | object | null | Object config theo key — mỗi key là tên param, value là field definition (xem bên dưới) |
Schema Config Field
Config là object theo key, mỗi key là tên tham số (ví dụ "aspectRatio", "numImages"). Key đặc biệt: _badges (badge hiển thị), maxRefImages (số ảnh tham chiếu tối đa).
| Field | Type | Description |
|---|---|---|
| type* | string | Loại field: "select", "card-select", "number", "text", "toggle", "upload" |
| label* | string | Nhãn hiển thị (English) |
| labelVi | string | Nhãn tiếng Việt |
| options | object[] | Options cho select/card-select [{value, label, imageUrl?}] |
| default | any | Giá trị mặc định |
| min | number | Giá trị tối thiểu (number) |
| max | number | Giá trị tối đa (number) |
| advanced | boolean | Nếu true, hiển thị trong phần nâng cao |
| optional | boolean | Nếu true, field không bắt buộc |
| creditCostMultiplier | boolean | Nếu true, giá trị nhân với creditCost (ví dụ numImages) |
Tip: Khi gửi job tạo nội dung, đưa giá trị config vào params cùng cấp với prompt và model.
Ví dụ response
json
{
"success": true,
"data": [
{
"slug": "nano-banana-2",
"displayName": "Nano Banana 2",
"category": "image",
"creditCost": 5,
"description": "Tạo ảnh AI chất lượng cao...",
"imageUrl": "https://blob.sangtao.ai/assets/models/img-nano-banana-2.webp",
"config": {
"aspectRatio": {
"type": "card-select",
"label": "Aspect Ratio",
"labelVi": "Tỉ lệ khung hình",
"options": [
{ "value": "1:1", "label": "1:1", "imageUrl": "/img/config-icons/ratio-1x1.svg" },
{ "value": "16:9", "label": "16:9", "imageUrl": "/img/config-icons/ratio-16x9.svg" },
{ "value": "9:16", "label": "9:16", "imageUrl": "/img/config-icons/ratio-9x16.svg" }
],
"default": "1:1",
"advanced": true,
"optional": true
},
"numImages": {
"type": "number",
"label": "Number of Images",
"labelVi": "Số lượng ảnh",
"min": 1,
"max": 4,
"default": 1,
"advanced": true,
"creditCostMultiplier": true
}
}
}
]
}Danh mục Model
| Category | Mô tả |
|---|---|
| image | Tạo ảnh AI (GPT Image, Nano Banana, Imagen, FLUX...) |
| video | Tạo video AI (Veo, Grok...) |
| voiceovervideo | Video voiceover AI với ảnh tạo tự động |
| stockvideo | Video stock với AI voiceover (Pexels) |
| slideshowvideo | Video slideshow từ ảnh |
| inpaint | Chỉnh sửa / inpaint ảnh |
| creativevideo | Trình biên tập video sáng tạo (Fast / Pro / Ultra) |
| articlevideo | Chuyển bài viết thành video |
| highlightvideo | Trích xuất highlight video |
| render | Pipeline render video |
| scrape | Tiện ích scrape web |