API docs · Assets
Asset types and real-person verification
trust_class, virtual characters and face verification for real-person photos.
When you create an asset, declare its type with trust_class. The platform does not detect faces on its own; your declaration is what counts. It cannot be changed later: if you declared the wrong type, delete the asset and upload it again.
| trust_class | For | Before it can be used |
|---|---|---|
normal | Regular images, videos and audio (default) | Usable once processed |
virtual_avatar | Virtual characters such as AI-generated or cartoon figures, for a consistent likeness | Usable once processed; the first time it is used in a task, the platform syncs it to the processing channel's asset library (task status preparing), and the task is only routed to channels that have an asset library |
real_person | Photos of a real person (images only) | Starts as authorization_required; usable after the person in the photo completes real-person verification |
Verification flow
- Call
POST /v1/assets/{id}/portrait-authorizationswith{ "model": "…" }(the model you will use the asset with). It returns201and a verification object:statusispending, withh5_linkandexpires_at(30 minutes later). - Give
h5_linkto the person in the photo (for example as a QR code). They open it on a phone and follow the prompts to complete a face check. When they finish, the page lands on a notice page on this site; wait for the result in your app. - Poll
GET /v1/portrait-authorizations/{id}about every 5 seconds untilstatusbecomesverified,failedorexpired. The platform also checks in the background, so the status updates even if you don't poll. - Once
verified, the asset becomesavailableand can be used in tasks for that model.
You can also start it from the asset details in Console · Assets; the page shows a QR code and refreshes the result automatically.GET /v1/assets/{id}/portrait-authorizations lists the asset's recent verifications.
Verification status
| status | Meaning |
|---|---|
pending | Waiting for the person to complete the face check; h5_link is only returned in this state |
verified | Verified; verified_at is when it passed |
failed | Not verified; error gives the reason. You can start again |
expired | Not completed within 30 minutes. You can start again |
Verification is per model
A verification only applies to the model chosen when it was started. Submitting a task for another model with this asset returns 422 authorization_required; start another verification for that model. If the asset is already verified for the same model, starting again returns the existing verified record.
Errors
| HTTP | code | When |
|---|---|---|
| 422 | invalid_parameter | The asset is not real_person, not an image, or the model does not exist |
| 403 | permission_denied | Your account does not have access to the model |
| 404 | not_found | The asset or verification does not exist, or is not yours |
| 503 | no_available_channel | No real-person verification channel is available for the model right now; try again later |
asset_rejected.# Start verification: returns h5_link, valid for 30 minutes
curl https://api.aitoken.tools/v1/assets/asset_xxx/portrait-authorizations \
-H "Authorization: Bearer $AITOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seedance-2.0-standard"}'
# Send h5_link to the person in the photo for the face check, then poll until status is verified / failed / expired
curl https://api.aitoken.tools/v1/portrait-authorizations/auth_xxx \
-H "Authorization: Bearer $AITOKEN_API_KEY"