From ai-video
Create AI avatar videos with HeyGen — generate personalized videos at scale, create AI clones, build interactive avatars, use photo avatars, and manage video generation via API. Use when creating AI avatar videos, generating personalized video content, building video campaigns at scale, creating a digital twin, or automating video production. Triggers: "heygen", "AI avatar", "video avatar", "personalized video", "AI clone", "talking head video", "HeyGen API".
How this skill is triggered — by the user, by Claude, or both
Slash command
/ai-video:heygenThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate professional AI avatar videos at scale — from personalized outreach to scalable content production.
Generate professional AI avatar videos at scale — from personalized outreach to scalable content production.
export HEYGEN_API_KEY="your-heygen-api-key"
Get key at: app.heygen.com → Settings → API
curl -X POST "https://api.heygen.com/v2/video/generate" \
-H "X-Api-Key: $HEYGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video_inputs": [{
"character": {
"type": "avatar",
"avatar_id": "avatar_id_here",
"avatar_style": "normal"
},
"voice": {
"type": "text",
"voice_id": "voice_id_here",
"input_text": "Hello! Welcome to Hair Solutions. I'"'"'m excited to share our latest hair restoration treatment that has helped over 500 clients in Toronto."
},
"background": {
"type": "color",
"value": "#f8f4f0"
}
}],
"dimension": {"width": 1280, "height": 720},
"aspect_ratio": "16:9"
}'
curl "https://api.heygen.com/v1/video_status.get?video_id={video_id}" \
-H "X-Api-Key: $HEYGEN_API_KEY"
Response states: processing, completed, failed
curl "https://api.heygen.com/v2/avatars" \
-H "X-Api-Key: $HEYGEN_API_KEY"
curl "https://api.heygen.com/v2/voices" \
-H "X-Api-Key: $HEYGEN_API_KEY"
Generate unique videos for each customer or prospect:
import requests
import time
def generate_personalized_video(customer_name, treatment, heygen_api_key):
script = f"""
Hi {customer_name}! I'm reaching out from Hair Solutions Co.
Based on your interest in {treatment}, I wanted to personally walk you
through what the treatment involves and what results you can expect.
Book your free consultation at the link below — I'd love to meet you!
"""
payload = {
"video_inputs": [{
"character": {
"type": "avatar",
"avatar_id": "YOUR_AVATAR_ID",
"avatar_style": "normal"
},
"voice": {
"type": "text",
"voice_id": "YOUR_VOICE_ID",
"input_text": script.strip()
}
}],
"dimension": {"width": 1280, "height": 720}
}
response = requests.post(
"https://api.heygen.com/v2/video/generate",
headers={"X-Api-Key": heygen_api_key, "Content-Type": "application/json"},
json=payload
)
video_id = response.json()["data"]["video_id"]
# Poll for completion
while True:
status_response = requests.get(
f"https://api.heygen.com/v1/video_status.get?video_id={video_id}",
headers={"X-Api-Key": heygen_api_key}
).json()
if status_response["data"]["status"] == "completed":
return status_response["data"]["video_url"]
elif status_response["data"]["status"] == "failed":
raise Exception("Video generation failed")
time.sleep(10)
HeyGen's Streaming API enables real-time interactive avatars:
// Initialize streaming session
const sessionResponse = await fetch('https://api.heygen.com/v1/streaming.new', {
method: 'POST',
headers: {
'X-Api-Key': process.env.HEYGEN_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
quality: 'high',
avatar_name: 'YOUR_AVATAR_ID',
voice: { voice_id: 'YOUR_VOICE_ID' }
})
});
const { session_id, sdp } = await sessionResponse.json();
// Connect via WebRTC
// Use the sdp to establish WebRTC peer connection
// Then send text to make avatar speak in real-time
Upload a photo to create a custom avatar:
npx claudepluginhub vincent-laroche/hairsolutionsco-ai-toolkit --plugin ai-videoCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.