Nhân vật
Tạo nhân vật
Tạo nhân vật, để giữ cùng ngoại hình qua nhiều cảnh và nhiều video.
POST
https://api.sangtao.ai/v2/charactersXác thực
X-Api-Keystring · headerbắt buộcAPI key của bạn, tạo ở trang API key trong tài khoản.
Body
namestringbắt buộcTối đa 100 ký tự
appearanceDescriptionstringTối đa 1.000 ký tự
biographystringTối đa 2.000 ký tự
aliasesstringTối đa 200 ký tự
Response
Character vừa tạo, chưa có ảnh. Thêm ảnh bằng hai API ảnh tham chiếu: Tải ảnh tham chiếu, hoặc Thêm ảnh từ link.
Mã lỗi
| Mã | errorCode | Khi nào |
|---|---|---|
| 400 | VALIDATION_ERROR | Dữ liệu sai — thiếu name, hoặc một trường vượt giới hạn |
Khi lỗi, success là false, errorCode như bảng trên, kèm error là câu mô tả.
POST
/characterscurl -X POST "https://api.sangtao.ai/v2/characters" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Mèo Mướp",
"appearanceDescription": "orange tabby cat, chubby body",
"aliases": "Mướp, Bé Mướp"
}'{
"success": true,
"data": {
"id": "ch_3kT9qPz0B",
"name": "Mèo Mướp",
"appearanceDescription": "orange tabby cat, chubby body",
"biography": null,
"aliases": "Mướp, Bé Mướp",
"publishStatus": null,
"createdAt": "2026-11-08T09:12:44Z",
"updatedAt": "2026-11-08T09:12:44Z",
"refImages": []
}
}POST
/characterscurl -X POST "https://api.sangtao.ai/v2/characters" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Mèo Mướp",
"appearanceDescription": "orange tabby cat, chubby body",
"aliases": "Mướp, Bé Mướp"
}'{
"success": true,
"data": {
"id": "ch_3kT9qPz0B",
"name": "Mèo Mướp",
"appearanceDescription": "orange tabby cat, chubby body",
"biography": null,
"aliases": "Mướp, Bé Mướp",
"publishStatus": null,
"createdAt": "2026-11-08T09:12:44Z",
"updatedAt": "2026-11-08T09:12:44Z",
"refImages": []
}
}