HeyGen Voice Clone API

Instant voice cloning from one short recording.

PlaygroundAPI
Pricing
~7.18s
POST /v2/heygen-voice-clone · submit + poll
 1# pip install "segmind>=1.1.0"
 2# export SEGMIND_API_KEY="YOUR_API_KEY"
 3import segmind
 4
 5# Async (v2): submit to the queue and block until COMPLETED.
 6# run() returns the final result dict (600s deadline, 1.0s poll by default).
 7result = segmind.run(
 8    "heygen-voice-clone",
 9    name="Clay Studio Narrator (EN)",
10    audio_url="https://segmind-resources.s3.amazonaws.com/input/heygen-voice-clone-input-clay-studio-en-v2.mp3",
11    language="en",
12    gender="female",
13    age="young",
14    similarity="max",
15    remove_background_noise=True,
16)
17print(result["status"])                      # COMPLETED
18print(result.get("output"))                  # model output (e.g. media URL)
19print(result["metrics"]["inference_time"])   # server compute seconds
20
21# --- Or submit + poll manually (track request_id, control the cadence) ---
22from segmind import SegmindClient, InferenceFailed, InferenceTimeout
23
24client = SegmindClient()                      # reads SEGMIND_API_KEY
25payload = {
26    "name": "Clay Studio Narrator (EN)",
27    "audio_url": "https://segmind-resources.s3.amazonaws.com/input/heygen-voice-clone-input-clay-studio-en-v2.mp3",
28    "language": "en",
29    "gender": "female",
30    "age": "young",
31    "similarity": "max",
32    "remove_background_noise": True,
33}
34job = client.submit_async("heygen-voice-clone", **payload)
35print(job.request_id)                         # available immediately
36try:
37    result = job.wait(timeout=600, interval=1.0)
38except InferenceTimeout as e:
39    print("still running:", e.request_id)
40except InferenceFailed as e:
41    print("failed:", e.detail)

API Endpoint

POSThttps://api.segmind.com/v1/heygen-voice-clone

Parameters

audio_urlrequired
string (uri)

A clean recording of one speaker (MP3 or WAV; up to 3 minutes is used). 30 seconds to 2 minutes of clear speech works best.

namerequired
string

Display name for the cloned voice (1-64 characters). Use a clear label like Narrator or Host.

Default: "Clay Studio Narrator (EN)"
ageoptional
string

Optional voice age hint: young or old. Leave unset to auto-detect from the sample.

Allowed values :
Young→"young"
Old→"old"
genderoptional
string

Optional voice gender hint: male or female. Leave unset to auto-detect from the sample.

Allowed values :
Male→"male"
Female→"female"
languageoptional
string

Language spoken in the sample (en, es, hi, ...). Detected when unset.

remove_background_noiseoptional
boolean

Cleans the recording before cloning; enabled by default. Keep on for noisy or echoey samples.

Default: true
similarityoptional
string

How closely the clone tracks the sample. max is closest.

Allowed values :
Medium→"medium"
High→"high"
Extra high→"extra_high"
Max→"max"

Response Type

Returns: Audio

Asynchronous requests (v2)

Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.

  1. 1
    POST /v2/heygen-voice-clone

    Submit — returns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Poll — until COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Result — final response body

Status states

QUEUED— Accepted, waiting for a worker
PROCESSING— Running on a worker
COMPLETED— Done — result body is ready
FAILED— Errored (incl. content/RAI blocks)
  • A FAILED request is served as HTTP 422 — the body still carries the error detail.
  • An unknown or expired request_id returns HTTP 404.
  • Results are retained for 1 hour, then expire.
  • Content / RAI blocks surface as FAILED, not a separate state.
  • Track completion by polling the status endpoint.

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out