Portrait API
Portrait Actions for AIGC and LivenessFace assets.
Overview
The Portrait API manages virtual and real-person portrait assets. Use the resulting asset://<id> with Video Generation API.
Endpoint and protocol
$POST https://api.alltoken.ai/v1/portrait/?Action=CreateAsset&Version=2024-01-01All Actions use Authorization: Bearer <alltoken_api_key>, Content-Type: application/json, and a JSON body.
12 Actions reference
| Action | Version | Purpose |
|---|---|---|
CreateVisualValidateSession | 2024-01-01 | LivenessFace H5 session |
GetVisualValidateResult | 2024-01-01 | Get GroupId from BytedToken |
GetAssetGroup / ListAssetGroups / UpdateAssetGroup / DeleteAssetGroup | 2024-01-01 | Group management |
CreateAsset / GetAsset / ListAssets / UpdateAsset / DeleteAsset | 2024-01-01 | Asset management |
CreateAssetGroup | 2024-01-01 | AIGC group only |
CreateAssetGroup (AIGC only)
Create an AIGC virtual portrait group. LivenessFace groups are created by the H5 flow.
CreateAsset
Add a public media URL to a group. AssetType can be Image, Video, or Audio.
CreateVisualValidateSession (LivenessFace)
Create an H5 validation session and receive H5Link plus BytedToken.
GetVisualValidateResult (LivenessFace)
After resultCode=10000, exchange BytedToken for GroupId.
GetAsset / ListAssets / UpdateAsset / DeleteAsset
Read, list, update, or delete customer-scoped assets. Poll GetAsset until Status=Active.
GetAssetGroup / ListAssetGroups / UpdateAssetGroup / DeleteAssetGroup
Read, list, update, or delete customer-scoped portrait groups. DeleteAssetGroup releases quota.
Error codes
Unauthorized/ForbiddenQuotaExceededValidatePendingInvalidToken/TokenExpiredAIGCNotAvailable
Multi-tenant isolation
All read and mutation Actions are scoped to the API key's customer. Cross-tenant access is forbidden.