> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aihubmix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Doubao プライベートバーチャルポートレート素材

> 本人確認なしでバーチャルポートレート素材グループを作成し、画像をアップロードして Seedance 動画生成で利用します。

このページでは、本人確認を必要としないプライベートバーチャルポートレート素材の利用方法を説明します。パブリックバーチャルポートレートは対象外です。

## 前提条件

* `AIHUBMIX_API_KEY` を環境変数に設定します。
* 対象モデルとバーチャルポートレート機能を有効にします。
* モデルプロバイダーが取得できる公開 HTTPS 画像 URL を用意します。

## 素材グループを作成

`POST /ai/v1/asset-groups` に `kind: "virtual_portrait"` を指定します。成功時は `201` で、通常は `active`、認証状態は `not_required` になります。本人確認 Session は使用しません。

```bash theme={null}
BASE_URL="https://aihubmix.com"
curl --fail-with-body -sS -X POST "$BASE_URL/ai/v1/asset-groups" -H "Authorization: Bearer $AIHUBMIX_API_KEY" -H "Content-Type: application/json" -d '{"name":"バーチャルポートレート","kind":"virtual_portrait"}' | jq
```

## 画像を登録

```bash theme={null}
curl --fail-with-body -sS -X POST "$BASE_URL/ai/v1/asset-groups/<group_id>/assets" -H "Authorization: Bearer $AIHUBMIX_API_KEY" -H "Content-Type: application/json" -d '{"url":"https://example.com/virtual-portrait.jpg","asset_type":"image"}' | jq
```

`GET /ai/v1/assets/<asset_id>` で確認し、`active` になるまで動画には使用しません。画像 URL はログイン不要の公開 URL を使用します。

## 動画を生成

素材 ID を `asset://<asset_id>` として `POST /ai/v1/videos` の `input_references[].url` に指定します。`status=completed` を確認してから `GET /ai/v1/videos/<video_id>/content` で動画を取得します。

```bash theme={null}
curl --fail-with-body -sS -X POST "$BASE_URL/ai/v1/videos" -H "Authorization: Bearer $AIHUBMIX_API_KEY" -H "Content-Type: application/json" -d '{"model":"doubao-seedance-2-5-260628","prompt":"Make the virtual portrait smile naturally.","input_references":[{"type":"image_url","url":"asset://<asset_id>"}]}' | jq
```

`creating` または `reconciling` のグループは作成結果が未確定のため、自動削除されません。API Key は環境変数だけで管理してください。
