[Integrations](https://spiral.ai/integrations) › [opencode](https://spiral.ai/integrations/opencode) › [HeyGen Avatar IV](https://spiral.ai/integrations/opencode/heygen-avatar-iv)

# How to Use HeyGen Avatar IV in opencode

HeyGen Avatar IV turns a single photo into a speaking presenter for explainers, training, and updates. Its audio-driven expressions also suit illustrated and 3D characters with clearly readable faces.

|  |  |
| --- | --- |
| Model | HeyGen Avatar IV |
| Available through | fal |
| Category | Video |
| Price | $0.13 per second of output video. The video is as long as the audio, or the spoken script when there is none. |
| Returns | video |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with HeyGen Avatar IV in opencode

- Use HeyGen Avatar IV with the presenter portrait in this project to explain the latest changelog entry. Write about 60 spoken words covering the change and its practical benefit, then generate a video with restrained movement.
- Read this project's onboarding documentation and use HeyGen Avatar IV with its presenter image to make a welcome video. Explain the product's purpose and one first action in about 50 words.
- Use HeyGen Avatar IV and the project's instructor portrait to introduce the authentication guide. Base the script on the documentation, keep it under 70 words, and use punctuation that gives the explanation natural pauses.
- Find one recurring question in the project's support documentation. Use HeyGen Avatar IV with the support presenter image to deliver a direct answer in about 60 words, with a calm expression and minimal movement.
- Use HeyGen Avatar IV with the project's illustrated guide image to introduce its tutorial. Check that the character has clear eyes and lips, write a 40-word introduction, and choose expressive movement.

## How to set up HeyGen Avatar IV in opencode

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the server**: Leave out `--global` to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

```bash
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
```

2. **Sign in**: Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, `/mcps` starts the same sign-in.

```bash
opencode mcp auth spiral
```

3. **Check it**: Spiral shows as connected.

```bash
opencode mcp list
```

### Use the Spiral skill

1. **Send opencode this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run HeyGen Avatar IV**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "fal",
    "model": "fal-ai/heygen/avatar4/image-to-video",
    "input": {
      "image_url": "https://v3b.fal.media/files/b/0a90062c/A7EIviZqNxZ2HAs0yHeZ6_77a05b99-8588-4ffc-90aa-be7f9d34e9d3.png"
    }
  }'
```

Then paste one of the prompts above: opencode finds HeyGen Avatar IV on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/opencode

## HeyGen Avatar IV tools and prices

- [HeyGen Avatar IV Photo to Video](https://spiral.ai/tools/fal/fal-ai/heygen/avatar4/image-to-video) (fal): $0.13 per second of output video. The video is as long as the audio, or the spoken script when there is none.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| prompt |  | — | The text the avatar will speak |
| voice | Warm Pro Narrator, Chill Brian, Ivy, John Doe, Monika Sogam, Hope , Archer , Brittney, Patrick, David Castlemore, Michael C, Adam Stone , Juniper, Cassidy , Jessica Anne Bogart, Arabella, Andrew, Spuds Oxley , Grace Elder, Helen, Canyon Rivers, Derya - Lifelike - Excited 🤩, Mellow Marcus, Jack Sterling - Broadcaster 🎙️, Brenda - UGC - 1.mp4, Reid, Reagan, Terry, Jenny, Radio Rick, Denise, Tim in car - Excited 🤩, Iskander, Thompson, Delicate Daisy - Excited 🤩, Kingston, George UGC 1, Bold Blake, Jane, Expressive Evan, Marianne - IA, Aaron, Modern Recipe Host - Voice 1, Willow, Cute Chloe - Friendly 😊, Rafael, June - Lifelike, Crisp Chloe, Slick Simon, Nassim - Informative, Baritone Ben, Maxwell, Ellie Faye - Excited 🤩, Milani, Feisty Fiona - Excited 🤩, Professor Dean, Rose - UGC - 1.mp4, Shona, Hudson Wilder, Ann - IA, Alastair Kensington, Oxley, Christina, Andrew Rizz , Peyton, Gerardo - Outdoor, Chloe - Lifelike, Stephanie, Anthony - IA, Signal - Voice 1, Luca, Lisa - Voice 1, T.W.Tucker, Jack Sullivan - Serious 😐, Winter, Mireia - Lifelike, Georgia, Stella, Masha - Lifelike, Charming Charles - Friendly 😊, Serenity, Annie - Excited, Ralph, Bethany, Dominic, Mason Finn, Leena, Veteran Victor, Tamara, Nik Public, Calm Chloe, Sevik, Reilly, Raul, Imposing Ian, Relaxed Ray, Dexter - Professional, Relaxed Rick, Edwin, Rupert Blackwood, Ginny, Hope | — | Name of the voice to use for the avatar |
| audio_url |  | — | URL of an audio file for the avatar to lip-sync to. When provided, overrides prompt and voice. |
| talking_style | stable, expressive | stable | Talking style - 'stable' for minimal movement, 'expressive' for more animation |
| expression |  | — | Facial expression |
| background |  | — | Background configuration |

## What can you do with HeyGen Avatar IV in opencode?

Turn project documentation into presenter videos for releases, onboarding, and support with HeyGen Avatar IV. A coding agent can extract the relevant details, draft spoken copy, and pair it with a presenter image from the project.

### Product release explainers

Animate a product expert's portrait to explain one change, who benefits, and what to try first. Use a short spoken script based on the approved release notes.

### Customer onboarding welcomes

Turn a presenter's photo into a welcome that introduces the product and gives new customers one clear next action.

### Support answer videos

Use a support presenter's portrait to deliver a concise answer to a recurring question. Keep each clip focused on one problem and its resolution.

### Employee training introductions

Animate an instructor's photo to introduce a lesson, explain its purpose, and state what employees should learn.

### Weekly team updates

Turn an approved summary and a presenter's portrait into a brief update covering completed work, upcoming priorities, and one action for the audience.

### Character-led lessons

Give an illustrated or 3D guide a spoken explanation for a learning activity. Choose a design with clear eyes and lips rather than an exaggerated or obscured face.

### Social announcement videos

Animate a spokesperson's portrait for a short announcement with one message and a clear closing line. Match the voice's energy to the announcement.

## Overview

- [fal](https://spiral.ai/providers/fal)
- [All opencode guides](https://spiral.ai/integrations/opencode)

## HeyGen Avatar IV in other agents

- [Amp](https://spiral.ai/integrations/amp/heygen-avatar-iv)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/heygen-avatar-iv)
- [Claude](https://spiral.ai/integrations/claude-desktop/heygen-avatar-iv)
- [Claude Code](https://spiral.ai/integrations/claude-code/heygen-avatar-iv)
- [Cline](https://spiral.ai/integrations/cline/heygen-avatar-iv)
- [Codex](https://spiral.ai/integrations/codex/heygen-avatar-iv)
- [Cursor](https://spiral.ai/integrations/cursor/heygen-avatar-iv)
- [Devin](https://spiral.ai/integrations/devin/heygen-avatar-iv)
- [dots](https://spiral.ai/integrations/dots/heygen-avatar-iv)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/heygen-avatar-iv)
- [Gemini](https://spiral.ai/integrations/gemini/heygen-avatar-iv)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/heygen-avatar-iv)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/heygen-avatar-iv)
- [goose](https://spiral.ai/integrations/goose/heygen-avatar-iv)
- [Grok](https://spiral.ai/integrations/grok/heygen-avatar-iv)
- [Grok Build](https://spiral.ai/integrations/grok-build/heygen-avatar-iv)
- [Hermes](https://spiral.ai/integrations/hermes/heygen-avatar-iv)
- [Instinct](https://spiral.ai/integrations/instinct/heygen-avatar-iv)
- [Manus](https://spiral.ai/integrations/manus/heygen-avatar-iv)
- [Muse](https://spiral.ai/integrations/muse/heygen-avatar-iv)
- [Muse Code](https://spiral.ai/integrations/muse-code/heygen-avatar-iv)
- [n8n](https://spiral.ai/integrations/n8n/heygen-avatar-iv)
- [Notion](https://spiral.ai/integrations/notion/heygen-avatar-iv)
- [OpenClaw](https://spiral.ai/integrations/openclaw/heygen-avatar-iv)
- [Perplexity](https://spiral.ai/integrations/perplexity/heygen-avatar-iv)
- [Raycast](https://spiral.ai/integrations/raycast/heygen-avatar-iv)
- [VS Code](https://spiral.ai/integrations/vscode/heygen-avatar-iv)
- [Windsurf](https://spiral.ai/integrations/windsurf/heygen-avatar-iv)
- [Zapier](https://spiral.ai/integrations/zapier/heygen-avatar-iv)

## More opencode guides

- [HeyGen Avatar III Digital Twin](https://spiral.ai/integrations/opencode/heygen-avatar-iii-digital-twin)
- [HeyGen Avatar IV Digital Twin](https://spiral.ai/integrations/opencode/heygen-avatar-iv-digital-twin)
- [Hedra Character 3](https://spiral.ai/integrations/opencode/hedra-character-3)
- [HeyGen Avatar V Digital Twin](https://spiral.ai/integrations/opencode/heygen-avatar-v-digital-twin)
- [Happy Horse Video Edit](https://spiral.ai/integrations/opencode/happy-horse-video-edit)
- [HeyGen Filler Word Removal](https://spiral.ai/integrations/opencode/heygen-filler-word-removal)

## Questions about HeyGen Avatar IV in opencode

**Can opencode use HeyGen Avatar IV?**

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run HeyGen Avatar IV like any built-in tool.

**How much does HeyGen Avatar IV cost in opencode?**

$0.13 per second of output video. The video is as long as the audio, or the spoken script when there is none. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

**Do I need a fal account to use HeyGen Avatar IV in opencode?**

No. Spiral runs HeyGen Avatar IV on its own fal account. You sign in to Spiral once and never paste a key.

**How long does it take to set up HeyGen Avatar IV in opencode?**

About two minutes: add the server, then sign in, then check it.

**Does opencode wait while HeyGen Avatar IV runs?**

HeyGen Avatar IV runs in the background. opencode starts the run, checks on it and gives you the video when it's ready.

**What is HeyGen Avatar IV good at?**

Use it for a presenter delivering a scripted explanation, update, lesson, or customer message. It turns a single photo into speech with facial expressions and gestures.

**Can HeyGen Avatar IV animate a cartoon or 3D character?**

Yes. HeyGen recommends Avatar IV for virtual characters, including 2D, 3D, and non-human avatars. Choose a character with a readable face and proportions close to a human face.

**Why does lip sync look weak on some characters?**

Highly exaggerated facial proportions can reduce lip-sync accuracy and facial movement. Start with a character whose eyes, mouth, and lips are easy to distinguish.

**How should I write an Avatar IV script?**

Write the words the presenter should say, then punctuate them to reflect the intended pacing. Avatar IV reads pacing and punctuation from the script, so review the text aloud before generating.

**How can I make the performance more expressive?**

Match the vocal delivery to the intended mood because Avatar IV uses tone, rhythm, and emotion to drive expressions. For a more animated performance, choose the expressive talking style.

