Tutorial
HeyGen Avatar 6 API for training videos you can update
Build a training video from three HeyGen Avatar 6 Turbo scenes for $6.15 at 1080p. Save each task ID and render only the scene that needs a revision.

Record one narration file per scene and submit each scene separately to HeyGen Avatar 6 Turbo through API Stock. An 80-second training video split into three recordings bills for 82 seconds, or $6.15 at 1080p at the 2 December 2026 rate. If the middle instruction changes, a new take of that 30-billed-second scene costs $2.25, and you can keep the other two clips.
Where should you split a training video?
Cut at the boundaries of instructions that change independently. For a lesson about a pressure sensor, record the inspection, calibration and verification as three scenes. If the calibration menu moves in a new firmware version, rerecord that section and keep the opening and closing.
Use one recording of 2–60 seconds and at most 15 MB per request. Leave a small pause for the cut and measure the exported recording, including any silence. Reuse an approved presenter photo, a consistent crop and the same output resolution across scenes. Use your own portrait and voice or get the presenter's permission to use both. Place cuts over a slide or a close-up of the equipment if the avatar's pose changes abruptly at a join.
How much does an 80-second lesson cost?
Round up each recording to a whole second before adding the billed durations. The following is a budget example using the 2 December 2026 catalog rates for 1080p. It assumes one successful generation per scene.
| Scene | Audio duration | Billed seconds | Turbo at $0.075/s | Avatar 6 at $0.15/s |
|---|---|---|---|---|
| 01 Inspect | 23.4 s | 24 | $1.80 | $3.60 |
| 02 Calibrate | 29.5 s | 30 | $2.25 | $4.50 |
| 03 Verify | 27.1 s | 28 | $2.10 | $4.20 |
| Total | 80.0 s | 82 | $6.15 | $12.30 |
For the same 82 billed seconds at 2K, the listed rates are $0.13/s for Turbo ($10.66) and $0.21/s for Avatar 6 ($17.22). Start with a single scene at the resolution you plan to deliver. Compare its cut and voice sync with your source before committing the rest of the budget. The figures above compare API rates, and the example includes no measured render speed or avatar quality.
How do you submit one scene and keep its task ID?
For the middle scene, set API_STOCK_KEY, PORTRAIT_URL and AUDIO_URL in your shell. Both URLs must be reachable by the service. In photo-to-video mode, send a single image in imageUrls and leave out videoUrl. The output follows the image's aspect ratio and the recording's duration.
Save a stable key with the scene revision before your first POST. This example uses sensor-lesson-20261202-02-r1. Change the project part to a unique identifier for your lesson and use one key per revision and scene. The optional cost cap here sets a $2.25 maximum for the individual request. Update it if you change the input duration or resolution.
set -euo pipefailscene_key='sensor-lesson-20261202-02-r1'payload=$(jq -n --arg photo "${PORTRAIT_URL:?}" --arg audio "${AUDIO_URL:?}" '{model: "heygen-avatar-6-turbo",input: {audioUrl: $audio, imageUrls: [$photo], resolution: "1080p"}}')curl -fsS 'https://api.api-stock.com/api/v1/generation/create-idempotent' \-H "Authorization: Bearer ${API_STOCK_KEY:?}" \-H "Idempotency-Key: $scene_key" \-H 'X-Max-Cost-Micro-USD: 2250000' \-H 'Content-Type: application/json' \--data "$payload" \| jq -er '.data.taskId' > "$scene_key.task-id.tmp"mv "$scene_key.task-id.tmp" "$scene_key.task-id"
If the POST response goes missing, resubmit the same request body with the same key on the same account and storefront. That returns the existing task ID if the first request created a task. Keep the original URL strings with the request record so you can reconstruct the body. If you have a task ID, use the status endpoint to check progress.
task_id=$(cat "$scene_key.task-id")curl -fsS "https://api.api-stock.com/api/v1/task/status/$task_id" \-H "Authorization: Bearer ${API_STOCK_KEY:?}" \| jq '.data | {status, files, errorMessage}'
Back off between checks while the task is queued or processing. On finished, download the video URL from files and save the MP4 alongside the scene revision in your project storage. Handle failed and expired as terminal results. The example uses the public API schema and was checked with simulated responses.
What should you review before replacing a scene?
Compare the new clip with both neighbours in the editor. Check that the voice level and framing match. Watch the first and last words at normal speed to catch clipped audio or an abrupt transition. Verify that captions and any on-screen instructions follow the revised narration, especially if the new clip runs longer.
Keep the old MP4 until the replacement passes review. Send a new key such as sensor-lesson-20261202-02-r2 for the deliberate revision and keep the approved scene IDs for the opening and closing. The lesson project can then record exactly which three revisions went into its next export.
FAQ
Can HeyGen Avatar 6 render the full 80 seconds in one request?
The photo-to-video input on API Stock accepts up to 60 seconds of speech per request. Submit the three scenes as separate tasks and join the downloaded clips in your editor.
Does splitting the recording change the bill?
Yes. Each scene's recorded duration rounds up separately, so 80.0 actual seconds in this example become 82 billed seconds.
Should I reuse the same idempotency key after changing the audio?
Assign a new key to the revised scene. Reserve the original key for recovering the original request when its outcome is uncertain.
Can I try one scene before wiring up the workflow?
Yes. Upload your authorized portrait and a short recording in the Avatar 6 Turbo playground. Try a cut against neighbouring footage before budgeting for the full lesson.
- heygen
- video
- training
- avatar
Try it with your own key
Choose a model in the API Stock catalog, check its price and try it in your browser or through the API.
Read next
TutorialMAGI-2 API: generate and retrieve a 1080p clipMake a 1080p MAGI-2 video from a prompt, budget $1.21 for 10 seconds, and resume polling the same video task when your local wait ends.·4 min read
TutorialGemini Omni 1.2 Flash API: video edits, duration and costCreate, edit or extend video with Gemini Omni 1.2 Flash: compare 1.1 prices, calculate billable seconds, and follow one API task through to a saved file.·7 min read
TutorialGemini 4 Neon API for tracing links across documentsUse Gemini 4 Neon to trace dependencies across source excerpts, verify each link, and budget $0.05625 for 20,000 uncached input tokens and 1,000 output tokens.·4 min read

