Skip to main content

The Problem

Documentation is essential but most people don’t read it. Video walkthroughs get significantly more engagement — but recording, editing, and keeping them in sync with doc changes costs more than most teams can justify.

How It Works

Doc changes → LLM writes a video prompt → Video Agent renders → Embed or distribute
You don’t send docs directly to Video Agent. An LLM converts documentation into a structured video prompt — acting as a video producer who reads the source material and writes production direction.

Build It

1

Extract the content

# From a file
with open("README.md") as f:
    content = f.read()

# Or from a URL
import requests
content = requests.get(
    "https://raw.githubusercontent.com/your-org/repo/main/README.md"
).text
2

Generate a video prompt with an LLM

import anthropic

client = anthropic.Anthropic()

message = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=[{
        "role": "user",
        "content": f"""You are a video producer. Convert this documentation
into a HeyGen Video Agent prompt.

Structure as 3–5 scenes with timing. Open with a hook explaining what this
does and why it matters. Walk through key points visually. End with a next
step. Target: 60 seconds. Be specific about visuals.

Documentation:
{content}

Output ONLY the Video Agent prompt."""
    }],
)
video_prompt = message.content[0].text
The two-stage pattern: Content → LLM (writes production prompt) → Video Agent (renders). The LLM bridges the gap between “what the docs say” and “what the video should show.”
3

Submit to Video Agent

resp = requests.post(
    "https://api.heygen.com/v3/video-agents",
    headers={
        "X-Api-Key": HEYGEN_API_KEY,
        "Content-Type": "application/json",
    },
    json={"prompt": video_prompt},
)
video_id = resp.json()["data"]["video_id"]
Optionally attach screenshots or diagrams as file inputs. Then poll for completion.

CI/CD Integration

Trigger video generation automatically when documentation changes:
# .github/workflows/docs-video.yml
name: Generate Doc Video
on:
  push:
    paths: ['docs/**', 'README.md', 'CHANGELOG.md']

jobs:
  generate-video:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Generate video
        env:
          HEYGEN_API_KEY: ${{ secrets.HEYGEN_API_KEY }}
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: python scripts/generate-doc-video.py
Store API keys as GitHub encrypted secrets. Never commit them.

Variations

  • Changelog videos: “Here’s what’s new in v2.3” — generate for each release
  • API docs: Walk through new endpoints or breaking changes visually
  • Onboarding: Auto-generate “Getting Started” videos from quickstart guides
  • Multi-language: Generate, then translate for international docs

Next Steps

Content Repurposing

Apply the same pattern to blog posts and articles.

Automated Broadcast

Schedule video generation pipelines.