Models

GEThttps://sangtao.ai/api/v2/models

Tà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

FieldTypeDescription
categorystringLọ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

FieldTypeDescription
slug*stringID duy nhất — dùng làm param model trong endpoint tạo nội dung
displayName*stringTên hiển thị
category*stringCategory viết thường (xem bảng bên dưới)
creditCost*numberChi phí credit cơ bản mỗi lần tạo
descriptionstringMô tả model (nullable)
imageUrlstringẢnh preview model (nullable)
configobject | nullObject 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).

FieldTypeDescription
type*stringLoại field: "select", "card-select", "number", "text", "toggle", "upload"
label*stringNhãn hiển thị (English)
labelVistringNhãn tiếng Việt
optionsobject[]Options cho select/card-select [{value, label, imageUrl?}]
defaultanyGiá trị mặc định
minnumberGiá trị tối thiểu (number)
maxnumberGiá trị tối đa (number)
advancedbooleanNếu true, hiển thị trong phần nâng cao
optionalbooleanNếu true, field không bắt buộc
creditCostMultiplierbooleanNế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

CategoryMô tả
imageTạo ảnh AI (GPT Image, Nano Banana, Imagen, FLUX...)
videoTạo video AI (Veo, Grok...)
voiceovervideoVideo voiceover AI với ảnh tạo tự động
stockvideoVideo stock với AI voiceover (Pexels)
slideshowvideoVideo slideshow từ ảnh
inpaintChỉnh sửa / inpaint ảnh
creativevideoTrình biên tập video sáng tạo (Fast / Pro / Ultra)
articlevideoChuyển bài viết thành video
highlightvideoTrích xuất highlight video
renderPipeline render video
scrapeTiện ích scrape web