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

# Training & Onboarding Videos

> Produce training and onboarding videos with the HeyGen API — update the script and regenerate when a policy or process changes.

## The Problem

Corporate training content is expensive to produce, goes stale fast, and doesn't scale across languages. A single compliance training video can cost \$5,000–\$15,000 to produce professionally — and needs to be re-recorded every time a policy changes.

## How It Works

```
Training docs/policies → LLM structures into video modules → Video Agent renders → Translate for global teams
```

Generate training videos from your existing materials. When the source document updates, regenerate the video. Need it in 10 languages? Use Video Translation.

## Build It

**1. Structure your training material**

Break content into modules. Each module becomes a separate video — this keeps videos short (2–5 minutes) and makes updates surgical.

```python theme={null}
modules = [
    {
        "title": "Data Privacy Basics",
        "source": "policies/data-privacy.pdf",
        "duration": "3 minutes",
        "style": "professional, clear, reassuring",
    },
    {
        "title": "Handling Customer Data",
        "source": "policies/data-handling.md",
        "duration": "4 minutes",
        "style": "professional, specific, example-driven",
    },
    {
        "title": "Reporting a Breach",
        "source": "policies/breach-response.md",
        "duration": "2 minutes",
        "style": "urgent but calm, step-by-step",
    },
]
```

**2. Generate video prompts with an LLM**

Use an LLM to convert each training document into a structured video prompt. The LLM acts as an instructional designer.

```python theme={null}
import anthropic

client = anthropic.Anthropic()

def generate_training_prompt(module, content):
    message = client.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=1500,
        messages=[{
            "role": "user",
            "content": f"""You are an instructional designer creating a training
video from a policy document. Convert this into a HeyGen Video Agent prompt.

Structure the video as:
1. Introduction (10s) — What this training covers and why it matters
2. Key concepts (60-70% of duration) — Break into 2-4 clear sections
   with specific examples and scenarios employees will recognize
3. Do's and Don'ts (15s) — Quick visual checklist
4. Summary + quiz teaser (10s) — Recap key points, prompt to take the quiz

Requirements:
- Tone: {module['style']}
- Duration: {module['duration']}
- Use text overlays for key terms and definitions
- Include scenario-based examples ("Imagine you receive an email from...")
- Make it engaging — this isn't a lecture, it's a conversation

Training document:
{content}

Output ONLY the Video Agent prompt."""
        }],
    )
    return message.content[0].text

# Generate prompt for each module
for module in modules:
    with open(module["source"]) as f:
        content = f.read()
    module["video_prompt"] = generate_training_prompt(module, content)
```

**3. Generate videos**

Submit each module to Video Agent. Space them out for rate limits.

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

HEYGEN_API_KEY = "your-api-key"

for module in modules:
    resp = requests.post(
        "https://api.heygen.com/v3/video-agents",
        headers={
            "X-Api-Key": HEYGEN_API_KEY,
            "Content-Type": "application/json",
        },
        json={
            "prompt": module["video_prompt"],
            # Optional: attach policy document for visual context
            # "files": [{"type": "url", "url": "https://..."}]
        },
    )
    module["video_id"] = resp.json()["data"]["video_id"]
    print(f"Submitted: {module['title']} → {module['video_id']}")
    time.sleep(5)
```

Then poll for completion — see [Video Agent docs](https://developers.heygen.com/docs/video-agent.md) for the polling pattern.

**4. Translate for global teams**

Once your English videos are ready, translate them for every region in one batch.

```python theme={null}
languages = ["Spanish", "French", "German", "Japanese", "Chinese", "Portuguese", "Korean"]

for module in modules:
    resp = requests.post(
        "https://api.heygen.com/v3/video-translations",
        headers={
            "X-Api-Key": HEYGEN_API_KEY,
            "Content-Type": "application/json",
        },
        json={
            "video": {"type": "url", "url": module["video_url"]},
            "output_languages": languages,
        },
    )
    module["translation_ids"] = resp.json()["data"]["video_translation_ids"]
    print(f"Translating {module['title']} into {len(languages)} languages")
```

Translating many modules? Submit them all in one call with [`POST /v3/video-translations/batches`](https://developers.heygen.com/reference/create-video-translation-batch) — see [Batch Video Translations](https://developers.heygen.com/batch-video-translations.md).

See [Video Translation docs](https://developers.heygen.com/docs/video-translate.md) for speed vs precision mode and all supported languages.

## Training Categories

This workflow applies to any training content:

| Category | Source material | Key considerations |
| - | - | - |
| **Compliance** (HIPAA, GDPR, SOX) | Regulatory docs, policies | Must be accurate, auditable, up-to-date |
| **Onboarding** | Employee handbook, culture docs | Warm and welcoming tone, company-specific |
| **Software training** | Help docs, screenshots | Attach screenshots as file inputs for visual context |
| **Safety** | Safety procedures, SOPs | Clear, step-by-step, scenario-based |
| **Sales enablement** | Product knowledge, objection handling | Conversational, example-heavy |

## Keeping Videos in Sync

The biggest advantage of generated training videos: **when the policy changes, regenerate the video.**

```
Policy doc updated → Detect change (git diff, CMS webhook, manual trigger)
                   → Re-run the same pipeline
                   → New video replaces the old one
                   → Re-translate if needed
```

No re-recording, no scheduling a film crew, no editing. Just re-run the pipeline.

## Variations

* **Interactive follow-up:** After the pre-rendered training video, launch a [Live Avatar AI Tutor](https://developers.heygen.com/live-avatar.md) for Q\&A and knowledge checks
* **Manager versions:** Generate a shorter executive summary version alongside the full training
* **Assessment-ready:** End each video with key questions that feed into your LMS quiz system

***

## Next Steps

> [card] [Multilingual Content](https://developers.heygen.com/multilingual-content)
>
> Deep dive into translating videos across languages.

> [card] [Live Avatar](https://developers.heygen.com/live-avatar.md)
>
> Add interactive Q\&A after training with a Live Avatar tutor.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.