Skip to content

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_classForBefore it can be used
normalRegular images, videos and audio (default)Usable once processed
virtual_avatarVirtual characters such as AI-generated or cartoon figures, for a consistent likenessUsable 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_personPhotos of a real person (images only)Starts as authorization_required; usable after the person in the photo completes real-person verification

Verification flow

  1. Call POST /v1/assets/{id}/portrait-authorizations with { "model": "…" } (the model you will use the asset with). It returns 201 and a verification object: status is pending, with h5_link and expires_at (30 minutes later).
  2. Give h5_link to 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.
  3. Poll GET /v1/portrait-authorizations/{id} about every 5 seconds until status becomes verified, failed or expired. The platform also checks in the background, so the status updates even if you don't poll.
  4. Once verified, the asset becomes available and 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

statusMeaning
pendingWaiting for the person to complete the face check; h5_link is only returned in this state
verifiedVerified; verified_at is when it passed
failedNot verified; error gives the reason. You can start again
expiredNot 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

HTTPcodeWhen
422invalid_parameterThe asset is not real_person, not an image, or the model does not exist
403permission_deniedYour account does not have access to the model
404not_foundThe asset or verification does not exist, or is not yours
503no_available_channelNo real-person verification channel is available for the model right now; try again later
# 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"