Prerequisites
- Set
AIHUBMIX_API_KEYin the environment. - Enable the target video model and virtual portrait asset capability for your account.
- Prepare a public HTTPS image URL that the model provider can fetch.
Create a group
Sendkind: "virtual_portrait" to POST /ai/v1/asset-groups. A successful request returns 201; the group normally becomes active with authorization status not_required.
Upload and wait for an image
status=processing. Query GET /ai/v1/assets/<asset_id> until the status is active. Do not use an asset while it is creating, processing, or reconciling. Use a public URL without login, private-network access, Base64 data, or embedded credentials. Images should be smaller than 30 MB, between 300 and 6000 pixels in both dimensions, and have an aspect ratio between 0.4 and 2.5.
Generate a video
Use the AIHubMix asset ID asasset://<asset_id>:
GET /ai/v1/videos/<video_id> until status=completed. Treat in_progress as pending and stop on failed or cancelled. Retrieve the completed video with GET /ai/v1/videos/<video_id>/content. Existing /v1/videos clients can place the reference in extra_body.content and retrieve content from /v1/videos/<id>/content.
Errors and deletion
asset_not_ready means that the asset is not active yet. asset_binding_mismatch means that the request references incompatible private assets. channel_pin_conflict means that an explicit channel does not match the asset binding. An unavailable channel returns channel_unavailable.
When a virtual group is creating or reconciling, its creation result is unknown. The service keeps the local record and recovery locator and does not automatically delete it. Keep API keys in environment variables and never include them in logs or support requests.