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

# Virtual Avatar Assets

>  - Private-domain virtual avatar asset submission API
- Supports batch submission, up to 20 assets per request
- Automatically creates or reuses asset groups; returns a task ID for status polling
- Approved assets can be used directly in Seedance 2.0 video generation 

<RequestExample>
  ```bash cURL (Batch submit · new group) theme={null}
  curl --request POST \
    --url https://gccai.heqingsong.uk/v1/seedance2/private-avatar \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "group": {
        "name": "virtual-avatar-group",
        "description": "demo group"
      },
      "project_name": "default",
      "asset_type": "Image",
      "assets": [
        {
          "url": "https://example.com/avatar-a.png",
          "name": "avatar-a"
        },
        {
          "url": "https://example.com/avatar-b.png",
          "name": "avatar-b"
        }
      ]
    }'
  ```

  ```bash cURL (Use existing group) theme={null}
  curl --request POST \
    --url https://gccai.heqingsong.uk/v1/seedance2/private-avatar \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "group_id": "group_xxx",
      "project_name": "default",
      "asset_type": "Image",
      "assets": [
        {
          "url": "https://example.com/avatar-a.png",
          "name": "avatar-a"
        }
      ]
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://gccai.heqingsong.uk/v1/seedance2/private-avatar"

  payload = {
      "group": {
          "name": "virtual-avatar-group",
          "description": "demo group"
      },
      "project_name": "default",
      "asset_type": "Image",
      "assets": [
          {
              "url": "https://example.com/avatar-a.png",
              "name": "avatar-a"
          },
          {
              "url": "https://example.com/avatar-b.png",
              "name": "avatar-b"
          }
      ]
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://gccai.heqingsong.uk/v1/seedance2/private-avatar";

  const payload = {
    group: {
      name: "virtual-avatar-group",
      description: "demo group"
    },
    project_name: "default",
    asset_type: "Image",
    assets: [
      {
        url: "https://example.com/avatar-a.png",
        name: "avatar-a"
      },
      {
        url: "https://example.com/avatar-b.png",
        name: "avatar-b"
      }
    ]
  };

  const headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
  };

  fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(payload)
  })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "data": {
      "id": "task_01K...",
      "object": "seedance.avatar.asset.task",
      "status": "processing",
      "progress": 10,
      "model": "doubao-seedance-2.0"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": 400,
      "message": "Invalid request parameters",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "Authentication failed. Please check your API key.",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "Insufficient account balance. Please top up and try again.",
      "type": "payment_required"
    }
  }
  ```

  ```json 429 theme={null}
  {
    "error": {
      "code": 429,
      "message": "Too many requests. Please try again later.",
      "type": "rate_limit_error"
    }
  }
  ```

  ```json 500 theme={null}
  {
    "error": {
      "code": 500,
      "message": "Internal server error. Please try again later.",
      "type": "server_error"
    }
  }
  ```
</ResponseExample>

## Authentication

<ParamField header="Authorization" type="string" required>
  All requests require Bearer Token authentication

  Get your API Key:

  Visit the [API Key Management page](https://gccai.heqingsong.uk/keys) to obtain your API Key

  Add the following header to each request:

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Request Parameters

<ParamField body="group" type="object">
  Asset group information

  If `group_id` is not provided, the server will automatically create an `AIGC` asset group based on this field

  <Expandable title="Fields">
    <ParamField body="name" type="string">
      Asset group name
    </ParamField>

    <ParamField body="description" type="string">
      Asset group description
    </ParamField>
  </Expandable>

  Example:

  ```json theme={null}
  {
    "group": {
      "name": "virtual-avatar-group",
      "description": "demo group"
    }
  }
  ```

  <Warning>
    Mutually exclusive with `group_id` — do not provide both at the same time
  </Warning>
</ParamField>

<ParamField body="group_id" type="string">
  Existing asset group ID

  When provided, skips group creation and submits assets directly to the specified group

  <Warning>
    Mutually exclusive with `group` — do not provide both at the same time
  </Warning>
</ParamField>

<ParamField body="project_name" type="string" default="default">
  Project name

  Default: `default`
</ParamField>

<ParamField body="asset_type" type="string" default="Image">
  Asset type

  Options:

  * `Image` - Image asset (default)
  * `Video` - Video asset
  * `Audio` - Audio asset

  Default: `Image`
</ParamField>

<ParamField body="assets" type="array">
  Asset list, supports submitting multiple assets in one request

  <Warning>
    Maximum **20** assets per submission
  </Warning>

  <Expandable title="Fields">
    <ParamField body="url" type="string" required>
      Asset URL — must be publicly accessible
    </ParamField>

    <ParamField body="name" type="string" required>
      Asset name
    </ParamField>
  </Expandable>

  Example:

  ```json theme={null}
  {
    "assets": [
      {
        "url": "https://example.com/avatar-a.png",
        "name": "avatar-a"
      },
      {
        "url": "https://example.com/avatar-b.png",
        "name": "avatar-b"
      }
    ]
  }
  ```
</ParamField>

<ParamField body="url" type="string">
  Single-asset shorthand: asset URL

  <Warning>
    Use either `assets` array or this field — not both. Suitable for submitting a single asset.
  </Warning>
</ParamField>

<ParamField body="name" type="string">
  Single-asset shorthand: asset name

  <Warning>
    Use either `assets` array or this field — not both. Suitable for submitting a single asset.
  </Warning>
</ParamField>

## Response

<ResponseField name="code" type="integer">
  Response status code, 200 on success
</ResponseField>

<ResponseField name="data" type="object">
  Task information

  <Expandable title="Fields">
    <ResponseField name="id" type="string">
      Local task ID, used to query asset review status
    </ResponseField>

    <ResponseField name="object" type="string">
      Task object type, always `seedance.avatar.asset.task`
    </ResponseField>

    <ResponseField name="status" type="string">
      Initial task status, `processing` after submission
    </ResponseField>

    <ResponseField name="progress" type="integer">
      Task progress (0 \~ 100)
    </ResponseField>

    <ResponseField name="model" type="string">
      Model name in use
    </ResponseField>
  </Expandable>
</ResponseField>

## Examples

### Example 1: Batch submit (auto-create group)

When `group_id` is not provided, the server automatically creates an `AIGC` asset group before submitting.

```json theme={null}
{
  "group": {
    "name": "virtual-avatar-group",
    "description": "demo group"
  },
  "project_name": "default",
  "asset_type": "Image",
  "assets": [
    {
      "url": "https://example.com/avatar-a.png",
      "name": "avatar-a"
    },
    {
      "url": "https://example.com/avatar-b.png",
      "name": "avatar-b"
    }
  ]
}
```

### Example 2: Append assets to an existing group

Provide `group_id` to skip group creation and submit directly.

```json theme={null}
{
  "group_id": "group_xxx",
  "project_name": "default",
  "asset_type": "Image",
  "assets": [
    {
      "url": "https://example.com/avatar-a.png",
      "name": "avatar-a"
    }
  ]
}
```

### Example 3: Single-asset shorthand

For a single asset, use the top-level `url` and `name` fields directly.

```json theme={null}
{
  "group_id": "group_xxx",
  "url": "https://example.com/avatar.png",
  "asset_type": "Image",
  "name": "avatar-1"
}
```

## Query Review Result

Asset submission is an asynchronous task. Use the [Get Task Status](/en/api-reference/tasks/status) endpoint to poll:

```http theme={null}
GET /v1/tasks/{id}
```

### All Approved

```json theme={null}
{
  "code": 200,
  "data": {
    "id": "task_01K...",
    "status": "completed",
    "progress": 100,
    "result": {
      "assets": [
        {
          "asset_id": "asset_a",
          "asset_url": "asset://asset_a",
          "status": "Active"
        },
        {
          "asset_id": "asset_b",
          "asset_url": "asset://asset_b",
          "status": "Active"
        }
      ],
      "usable_assets": [
        {
          "asset_id": "asset_a",
          "asset_url": "asset://asset_a",
          "status": "Active"
        },
        {
          "asset_id": "asset_b",
          "asset_url": "asset://asset_b",
          "status": "Active"
        }
      ],
      "failed_assets": []
    }
  }
}
```

### Partial Failure

If any asset fails review, the task status becomes `failed`. Successfully approved assets remain usable and appear in `result.usable_assets`.

```json theme={null}
{
  "code": 200,
  "data": {
    "id": "task_01K...",
    "status": "failed",
    "progress": 100,
    "result": {
      "assets": [
        {
          "asset_id": "asset_a",
          "asset_url": "asset://asset_a",
          "status": "Active"
        },
        {
          "asset_id": "asset_b",
          "asset_url": "asset://asset_b",
          "status": "Failed"
        }
      ],
      "usable_assets": [
        {
          "asset_id": "asset_a",
          "asset_url": "asset://asset_a",
          "status": "Active"
        }
      ],
      "failed_assets": [
        {
          "asset_id": "asset_b",
          "asset_url": "asset://asset_b",
          "status": "Failed"
        }
      ]
    },
    "error": {
      "code": "task_failed",
      "message": "Some assets failed review"
    }
  }
}
```

<Note>
  * `result.usable_assets[].asset_url` can be used directly in Seedance 2.0 video generation
  * Assets in `result.failed_assets` must be replaced or resubmitted
  * Single-asset tasks also return `result.asset_url` for compatibility
</Note>

## Using Approved Assets

Pass the `asset://...` URL directly to the [Seedance 2.0 Video Generation](/en/api-reference/videos/doubao-seedance-2-0/generation) endpoint:

```json theme={null}
{
  "model": "doubao-seedance-2.0",
  "prompt": "The character walks naturally along a city street",
  "image_urls": ["asset://asset_a"],
  "duration": 5,
  "resolution": "720p"
}
```

<Note>
  Once the server detects the `asset://` prefix, it submits the generation task directly without triggering another asset review.
</Note>
