Unlike virtual portraits, real-person portraits require real-person verification first. The person being filmed must complete liveness verification and grant authorization through the mobile H5 page. Only after verification is approved can you obtain an asset group to which assets can be submitted. The API also uses the Volcengine Ark native Action protocol (POST /?Action=...&Version=2024-01-01, JSON request body, PascalCase fields), and authentication requires only a MaiToken API Key.
Complete process:
- Create a real-person verification session to obtain the verification credential (BytedToken) and H5 verification link
- Have the person being filmed open the H5 page and complete liveness verification
- Query the verification result to obtain the asset group Id (the group will then belong to your account)
- Submit real-person assets to the group, poll their status, and use them in generation once ready
Authorizations
All requests use Bearer Token authentication. Obtain an API Key: visit the API Key management page
Authorization: Bearer YOUR_API_KEYIntegration Process
sequenceDiagram participant Client as Caller participant MaiToken as MaiToken participant User as Person Being Filmed Client->>MaiToken: 1. CreateVisualValidateSession MaiToken-->>Client: Result.BytedToken + H5 verification link User->>User: 2. Open H5 and complete liveness verification and authorization Client->>MaiToken: 3. GetVisualValidateResult (BytedToken) MaiToken-->>Client: Result.GroupId (real-person asset group) Client->>MaiToken: 4. CreateAsset (GroupId + asset URL) MaiToken-->>Client: Result.Id (asset-*) loop Until the asset is available Client->>MaiToken: 5. GetAsset (Id) MaiToken-->>Client: Result.Status endStep 1: Create a Real-Person Verification Session
Call CreateVisualValidateSession to initiate verification. The Result in the response contains the BytedToken (the credential used to query the verification result later, valid for 30 minutes) and the H5 verification link for the person being filmed to open.
Request body fields:
CallbackURL(optional): The callback URL invoked after verification is completed. In the callback parameters,resultCode=10000indicates successful verification.
Step 2: Have the Person Being Filmed Complete H5 Verification
Send the H5 link to the person being filmed. They must complete liveness verification and grant portrait authorization on a mobile device. If CallbackURL is configured, resultCode=10000 in the callback parameters indicates success.
Step 3: Query the Verification Result and Claim the Asset Group
After verification is completed, call GetVisualValidateResult with the BytedToken. On success, it returns the real-person asset group Id generated by the verification. This call also claims the asset group for your account, after which you can perform asset operations on it.
Note: BytedToken must be the credential returned by a session you created yourself; using someone else's credential will return a 404 asset_not_found.
Step 4: Submit Real-Person Assets
POST /?Action=CreateAsset&Version=2024-01-01After obtaining the GroupId, use the same CreateAsset / GetAsset endpoints as for virtual avatar assets to submit and poll the asset (see Virtual Avatar Assets for field and status descriptions).
Each submission undergoes a facial identity consistency check against the verified person. Assets that fail the check cannot be stored. Only assets of the same person can be submitted to a given asset group.
Status Descriptions
- Processing — The asset has been submitted and is undergoing review and identity consistency verification.
- Active — The asset is available and can be referenced in the video generation API as
asset://<ASSET_ID>(in the same way as Virtual Avatar Assets). - Failed — Processing failed. Common causes include a mismatch between the asset and the verified person, blurring, obstruction, multiple people in the frame, or an inaccessible URL.
Common Causes of Failure
- The H5 link expired (the verification session is valid for 30 minutes), or the person being recorded did not complete verification in time
GetVisualValidateResultwas called before verification was completed- A verification session credential created by someone else was used (404
asset_not_found) - The submitted asset did not match the verified person and failed the identity consistency check
- The asset URL was inaccessible or the asset quality was too low
