Skip to content
API Reference · Portrait API

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

Endpoint
$POST https://api.alltoken.ai/v1/portrait/?Action=CreateAsset&amp;Version=2024-01-01

All Actions use Authorization: Bearer <alltoken_api_key>, Content-Type: application/json, and a JSON body.

12 Actions reference

ActionVersionPurpose
CreateVisualValidateSession2024-01-01LivenessFace H5 session
GetVisualValidateResult2024-01-01Get GroupId from BytedToken
GetAssetGroup / ListAssetGroups / UpdateAssetGroup / DeleteAssetGroup2024-01-01Group management
CreateAsset / GetAsset / ListAssets / UpdateAsset / DeleteAsset2024-01-01Asset management
CreateAssetGroup2024-01-01AIGC 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 / Forbidden
  • QuotaExceeded
  • ValidatePending
  • InvalidToken / TokenExpired
  • AIGCNotAvailable

Multi-tenant isolation

All read and mutation Actions are scoped to the API key's customer. Cross-tenant access is forbidden.

Try in Interactive Explorer