Xpersona
A

Avatar Video

CLAWHUB · Unverified

Create AI avatar videos with precise control over avatars, voices, scripts, and backgrounds using HeyGen's v3 API (POST /v3/videos). Two modes: type="avatar"...

62
Rank
84
Safety
1.4k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s171q3psxz493p60wc3kveddjx848c5x:avatar-video
  1. Install using `clawhub skill install s171q3psxz493p60wc3kveddjx848c5x:avatar-video` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/michaelwang11394/avatar-video before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-michaelwang11394-avatar-video/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

147,411 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: avatar-video
description: |
  Create AI avatar videos with precise control over avatars, voices, scripts, and backgrounds using HeyGen's v3 API (POST /v3/videos). Two modes: type="avatar" with avatar_id, or type="image" with an image AssetInput (Avatar IV). Use when: (1) Choosing a specific avatar and voice for a video, (2) Writing exact scripts for an avatar to speak, (3) Animating a photo into a speaking video (type="image"), (4) Transparent background videos with remove_background, (5) Integrating HeyGen avatars with Remotion, (6) Batch video generation with exact specs, (7) Brand-consistent production videos with precise control.
homepage: https://docs.heygen.com/reference/create-an-avatar-video
allowed-tools: mcp__heygen__*
metadata:
  openclaw:
    requires:
      env:
        - HEYGEN_API_KEY
    primaryEnv: HEYGEN_API_KEY
---

# Avatar Video

Create AI avatar videos with full control over avatars, voices, scripts, and backgrounds using `POST /v3/videos`. Two creation modes via discriminated union on `type`:
- `"type": "avatar"` + `avatar_id` — use a HeyGen avatar from the library
- `"type": "image"` + `image` (AssetInput) — animate any photo via Avatar IV

## Authentication

All requests require the `X-Api-Key` header. Set the `HEYGEN_API_KEY` environment variable.

```bash
curl -X GET "https://api.heygen.com/v3/avatars" \
  -H "X-Api-Key: $HEYGEN_API_KEY"
```

## Tool Selection

If HeyGen MCP tools are available (`mcp__heygen__*`), **prefer them** over direct HTTP API calls — they handle authentication and request formatting automatically.

| Task | MCP Tool | Fallback (Direct API) |
|------|----------|----------------------|
| Check video status / get URL | `mcp__heygen__get_video` | `GET /v3/videos/{video_id}` |
| List account videos | `mcp__heygen__list_videos` | `GET /v3/videos` |
| Delete a video | `mcp__heygen__delete_video` | `DELETE /v3/videos/{video_id}` |

Video generation (`POST /v3/videos`) and avatar/voice listing are done via direct API calls — see reference files below.

## Default Workflow

1. **List avatar looks** — `GET /v3/avatars/looks` → pick a look, note its `id` (this is the `avatar_id`) and `default_voice_id`. See [avatars.md](references/avatars.md)
2. **List voices** (if needed) — `GET /v3/voices` → pick a voice matching the avatar's gender/language. See [voices.md](references/voices.md)
3. **Write the script** — Structure scenes with one concept each. See [scripts.md](references/scripts.md)
4. **Generate the video** — `POST /v3/videos` with `avatar_id`, `voice_id`, `script`, and optional `background` per scene. See [video-generation.md](references/video-generation.md)
5. **Poll for completion** — `GET /v3/videos/{video_id}` until status is `completed`. See [video-status.md](references/video-status.md)

## Routing: This Skill vs Create Video

**This skill** = precise control (specific avatar, exact script, custom background).
**create-video** = prompt-based ("make me a video about X", AI handles the res

_meta.json

{
  "ownerId": "kn7dnc0jepdz3jy0rg589kcxns80dmr5",
  "slug": "avatar-video",
  "version": "2.23.0",
  "publishedAt": 1776103923333
}

references/assets.md

---
name: assets
description: Uploading images, videos, and audio for use in HeyGen video generation
---

# Asset Upload and Management

HeyGen allows you to upload custom assets (images, videos, audio) for use in video generation, such as backgrounds, talking photo sources, and custom audio.

## Upload Flow

Asset uploads are a single-step process: POST the raw file binary directly to the upload endpoint. The Content-Type header must match the file's MIME type.

## Uploading an Asset

**Endpoint:** `POST https://upload.heygen.com/v1/asset`

### Request

| Header | Required | Description |
|--------|:--------:|-------------|
| `X-Api-Key` | ✓ | Your HeyGen API key |
| `Content-Type` | ✓ | MIME type of the file (e.g. `image/jpeg`) |

The request body is the raw binary file data. No JSON or form fields are needed.

### Response

| Field | Type | Description |
|-------|------|-------------|
| `code` | number | Status code (`100` = success) |
| `data.id` | string | Unique asset ID for use in video generation |
| `data.name` | string | Asset name |
| `data.file_type` | string | `image`, `video`, or `audio` |
| `data.url` | string | Accessible URL for the uploaded file |
| `data.image_key` | string \| null | Key for creating uploaded photo avatars (images only) |
| `data.folder_id` | string | Folder ID (empty if not in a folder) |
| `data.meta` | string \| null | Asset metadata |
| `data.created_ts` | number | Unix timestamp of creation |

### curl

```bash
curl -X POST "https://upload.heygen.com/v1/asset" \
  -H "X-Api-Key: $HEYGEN_API_KEY" \
  -H "Content-Type: image/jpeg" \
  --data-binary '@./background.jpg'
```

### TypeScript

```typescript
import fs from "fs";
import path from "path";

interface AssetUploadResponse {
  code: number;
  data: {
    id: string;
    name: string;
    file_type: string;
    url: string;
    image_key: string | null;
    folder_id: string;
    meta: string | null;
    created_ts: number;
  };
  msg: string | null;
  message: string | null;
}

async function uploadAsset(filePath: string, contentType: string): Promise<AssetUploadResponse["data"]> {
  const resolvedPath = path.resolve(filePath);
  const fileBuffer = fs.readFileSync(resolvedPath);

  const response = await fetch("https://upload.heygen.com/v1/asset", {
    method: "POST",
    headers: {
      "X-Api-Key": process.env.HEYGEN_API_KEY!,
      "Content-Type": contentType,
    },
    body: fileBuffer,
  });

  const json: AssetUploadResponse = await response.json();

  if (json.code !== 100) {
    throw new Error(json.message ?? "Upload failed");
  }

  return json.data;
}

// Usage
const asset = await uploadAsset("./background.jpg", "image/jpeg");
console.log(`Uploaded asset: ${asset.id}`);
console.log(`Asset URL: ${asset.url}`);
```

### TypeScript (with streams for large files)

```typescript
import fs from "fs";
import path from "path";
import { stat } from "fs/promises";

async function uploadLargeAsset(filePath: string, contentType: string): Promise<Asset

references/avatars.md

---
name: avatars
description: Listing avatar groups and looks, filtering by type and ownership, and selecting the right avatar_id for video generation using the v3 API
---

# HeyGen Avatars

The v3 API organizes avatars into two levels:

- **Groups** represent a character (e.g., "Josh", "Angela"). A group has a name, preview images, and a default voice.
- **Looks** represent a specific outfit, style, or pose within a group. Each look has an `id` that you pass as `avatar_id` when creating a video via `POST /v3/videos`.

A single group can have multiple looks. For example, the "Josh" group might have looks for business attire, casual wear, and seasonal outfits.

## Previewing Avatars Before Generation

Always preview avatars before generating a video to ensure they match user preferences. Both groups and looks include preview URLs that can be opened directly in the browser.

### Preview Fields

| Level | Field | Description |
|-------|-------|-------------|
| Group | `preview_image_url` | Static image of the character (publicly accessible) |
| Group | `preview_video_url` | Short video clip showing the character |
| Look | `preview_image_url` | Static image of this specific look/outfit |
| Look | `preview_video_url` | Short video clip of this look in action |

Both URLs are publicly accessible -- no authentication needed to view them.

### Workflow: Preview Before Generate

1. **List avatar groups** -- browse available characters
2. **List looks for a group** -- see available outfits/styles
3. **Show preview URLs to user** -- share `preview_image_url` for visual check
4. **User selects** a look by name or ID
5. **Use `look.id` as `avatar_id`** and `look.default_voice_id` as `voice_id` in `POST /v3/videos`

## Listing Avatar Groups

List all avatar groups (characters) available to your account.

### curl

```bash
# List public avatar groups
curl -X GET "https://api.heygen.com/v3/avatars?ownership=public&limit=10" \
  -H "X-Api-Key: $HEYGEN_API_KEY"

# List your private avatar groups
curl -X GET "https://api.heygen.com/v3/avatars?ownership=private&limit=10" \
  -H "X-Api-Key: $HEYGEN_API_KEY"
```

### TypeScript

```typescript
interface AvatarGroupItem {
  id: string;
  name: string;
  preview_image_url: string | null;
  preview_video_url: string | null;
  gender: string | null;
  created_at: number;
  looks_count: number;
  default_voice_id: string | null;
}

interface AvatarGroupsResponse {
  data: AvatarGroupItem[];
  has_more: boolean;
  next_token: string | null;
}

async function listAvatarGroups(
  ownership: "public" | "private" = "public",
  limit: number = 50,
  token?: string
): Promise<AvatarGroupsResponse> {
  const params = new URLSearchParams({
    ownership,
    limit: limit.toString(),
  });
  if (token) {
    params.set("token", token);
  }

  const response = await fetch(
    `https://api.heygen.com/v3/avatars?${params}`,
    { headers: { "X-Api-Key": process.env.HEYGEN_API_KEY! } }
  );

  if (!response.ok) {
    throw new Error(`

references/backgrounds.md

---
name: backgrounds
description: Solid colors, images, and video backgrounds for HeyGen videos
---

# Video Backgrounds

HeyGen supports various background types to customize the appearance of your avatar videos.

## Background Types

| Type | Description |
|------|-------------|
| `color` | Solid color background |
| `image` | Static image background |
| `video` | Looping video background |

## Color Backgrounds

The simplest option - use a solid color:

```typescript
const videoConfig = {
  video_inputs: [
    {
      character: {
        type: "avatar",
        avatar_id: "josh_lite3_20230714",
        avatar_style: "normal",
      },
      voice: {
        type: "text",
        input_text: "Hello with a colored background!",
        voice_id: "1bd001e7e50f421d891986aad5158bc8",
      },
      background: {
        type: "color",
        value: "#FFFFFF", // White background
      },
    },
  ],
};
```

### Common Color Values

| Color | Hex Value | Use Case |
|-------|-----------|----------|
| White | `#FFFFFF` | Clean, professional |
| Black | `#000000` | Dramatic, cinematic |
| Blue | `#0066CC` | Corporate, trustworthy |
| Green | `#00FF00` | Chroma key (for compositing) |
| Gray | `#808080` | Neutral, modern |

### Using Transparent/Green Screen

For compositing in post-production:

```typescript
background: {
  type: "color",
  value: "#00FF00", // Green screen
}
```

## Image Backgrounds

Use a static image as background:

### From URL

```typescript
const videoConfig = {
  video_inputs: [
    {
      character: {
        type: "avatar",
        avatar_id: "josh_lite3_20230714",
        avatar_style: "normal",
      },
      voice: {
        type: "text",
        input_text: "Check out this custom background!",
        voice_id: "1bd001e7e50f421d891986aad5158bc8",
      },
      background: {
        type: "image",
        url: "https://example.com/my-background.jpg",
      },
    },
  ],
};
```

### From Uploaded Asset

First upload your image, then use the asset URL:

```typescript
// 1. Upload the image
const assetId = await uploadFile("./background.jpg", "image/jpeg");

// 2. Use in video config
const videoConfig = {
  video_inputs: [
    {
      character: {...},
      voice: {...},
      background: {
        type: "image",
        url: `https://files.heygen.ai/asset/${assetId}`,
      },
    },
  ],
};
```

### Image Requirements

- **Formats**: JPEG, PNG
- **Recommended size**: Match video dimensions (e.g., 1920x1080 for 1080p)
- **Aspect ratio**: Should match video aspect ratio
- **File size**: Under 10MB recommended

## Video Backgrounds

Use a looping video as background:

```typescript
const videoConfig = {
  video_inputs: [
    {
      character: {
        type: "avatar",
        avatar_id: "josh_lite3_20230714",
        avatar_style: "normal",
      },
      voice: {
        type: "text",
        input_text: "Dynamic video background!",
        voice_id: "1bd001e7e50f421d891986aad5158bc8",
      },
      background: {
   

Sponsored

Ads related to Avatar Video and adjacent AI workflows.