> ## Documentation Index
> Fetch the complete documentation index at: https://heygen-1fa696a7.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create or Retrain an Audio Voice

> Creates an instant voice with `mode: instant` from one recording, a professional voice with `mode: professional`, or a reusable HeyGen voice from a description in the requested language with `mode: design`. Every mode returns HTTP 202 with voice_id. Poll the voice until it is ACTIVE; a designed voice is ready once its preview_audio_url is set, a URL to a WAV clip of the new voice. An optional speaker image adapts the voice to the speaker's appearance and environment. Free-plan workspaces can make 20 instant-clone calls per rolling day by default. All members share the workspace limit. Text-based voice design has a separate daily limit. Workspace limits can differ. Instant and designed voices also count toward the workspace's voice clone limit, which depends on its plan; at the limit the request fails with `resource_limit_reached` until a voice is deleted. Instant voices do not support retraining. Use POST /v3/models/audio/tts/stream for streaming speech; model defaults to heygen-voice-1. Mode is required for both creation and retraining. Retrains a professional voice when `voice_id` is set. The voice is `PENDING` while training; poll GET /v3/models/audio/voices/{voice_id} until it is `ACTIVE` or `FAILED`. A new voice in professional mode needs a free professional-voice slot; each purchased slot provides five pooled trainings per monthly billing period, including the first, and failed trainings do not count. Send an Idempotency-Key to make retries safe.



## OpenAPI

````yaml /openapi/external-api.json post /v3/models/audio/voices
openapi: 3.1.0
info:
  title: HeyGen External API
  version: 1.0.0
  description: >-
    HeyGen's external API for programmatic AI video creation. See
    https://docs.heygen.com for full documentation.
  contact:
    name: HeyGen Product Infra
    url: https://heygen.com
servers:
  - url: https://api.heygen.com
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Video
    description: >-
      Create videos from a prompt or an avatar, then list, fetch, deliver and
      delete them
  - name: Avatar
    description: >-
      Create avatars and looks, record consent, and generate with the Avatar 6
      model
  - name: Voice
    description: Text to speech, speech to speech, and voice cloning
  - name: Audio
    description: Music, sound effects, transcription, stem separation and audio analysis
  - name: Image
    description: Generate images
  - name: Video editing
    description: >-
      Translate, lipsync, clip, analyze and remove filler words or backgrounds
      from existing videos
  - name: Video Agent
    description: Create videos from a prompt with an agent that plans, writes and edits
  - name: Templates
    description: Generate videos from reusable templates by replacing their variables
  - name: HyperFrames
    description: Render HyperFrames compositions into video
  - name: Brand
    description: >-
      Brand kits (colors, fonts, logos) and brand glossaries (term translations
      and pronunciations)
  - name: Assets and folders
    description: Upload files and organize them in folders
  - name: Batches
    description: Submit and track videos, translations, lipsyncs and uploads in bulk
  - name: Webhooks
    description: Manage webhook endpoints and events
  - name: Feedback
    description: Tell HeyGen how a generated result turned out
  - name: Account and usage
    description: Your account, the current API key, request logs and usage
paths:
  /v3/models/audio/voices:
    post:
      tags:
        - Voice
      summary: Create or Retrain an Audio Voice
      description: >-
        Creates an instant voice with `mode: instant` from one recording, a
        professional voice with `mode: professional`, or a reusable HeyGen voice
        from a description in the requested language with `mode: design`. Every
        mode returns HTTP 202 with voice_id. Poll the voice until it is ACTIVE;
        a designed voice is ready once its preview_audio_url is set, a URL to a
        WAV clip of the new voice. An optional speaker image adapts the voice to
        the speaker's appearance and environment. Free-plan workspaces can make
        20 instant-clone calls per rolling day by default. All members share the
        workspace limit. Text-based voice design has a separate daily limit.
        Workspace limits can differ. Instant and designed voices also count
        toward the workspace's voice clone limit, which depends on its plan; at
        the limit the request fails with `resource_limit_reached` until a voice
        is deleted. Instant voices do not support retraining. Use POST
        /v3/models/audio/tts/stream for streaming speech; model defaults to
        heygen-voice-1. Mode is required for both creation and retraining.
        Retrains a professional voice when `voice_id` is set. The voice is
        `PENDING` while training; poll GET /v3/models/audio/voices/{voice_id}
        until it is `ACTIVE` or `FAILED`. A new voice in professional mode needs
        a free professional-voice slot; each purchased slot provides five pooled
        trainings per monthly billing period, including the first, and failed
        trainings do not count. Send an Idempotency-Key to make retries safe.
      operationId: createModelAudioVoice
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAudioVoiceRequest'
      responses:
        '202':
          description: Accepted — submission acknowledged; poll for completion.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CreateModelAudioVoiceResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
              examples:
                invalid_audio:
                  summary: Source audio does not satisfy training requirements
                  value:
                    error:
                      code: invalid_parameter
                      message: >-
                        The supplied recordings must contain at least 20 minutes
                        of audio in total.
                      param: audio
                      doc_url: null
                voice_capacity:
                  summary: All purchased professional-voice slots are occupied
                  value:
                    error:
                      code: resource_limit_reached
                      message: >-
                        No professional voice slots are available. Purchase
                        another slot, or delete a voice after its training
                        finishes.
                training_allowance:
                  summary: >-
                    The monthly professional-voice training allowance is
                    exhausted
                  value:
                    error:
                      code: resource_limit_reached
                      message: >-
                        The monthly professional voice training allowance is
                        exhausted. Try again in the next billing period or
                        purchase another slot.
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired API key. Verify your x-api-key header.
                  param: null
                  doc_url: null
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
              example:
                error:
                  code: voice_not_found
                  message: Voice not found.
                  param: null
                  doc_url: null
        '409':
          description: >-
            Conflict — either the request conflicts with existing state, or a
            prior request with this `Idempotency-Key` is still in progress
            (`request_in_progress`).
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
              examples:
                conflict:
                  summary: Resource conflict
                  value:
                    error:
                      code: resource_not_ready
                      message: >-
                        The professional voice must be ACTIVE and have no
                        training in progress before it can be retrained.
                      param: null
                      doc_url: null
                request_in_progress:
                  summary: Concurrent retry with same Idempotency-Key
                  value:
                    error:
                      code: request_in_progress
                      message: >-
                        A request with this Idempotency-Key is already in
                        progress. Retry shortly.
                      param: null
                      doc_url: null
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
              example:
                error:
                  code: rate_limit_exceeded
                  message: >-
                    Too many requests. Retry after the duration specified in the
                    Retry-After header.
                  param: null
                  doc_url: null
          headers:
            Retry-After:
              description: Seconds to wait before retrying
              schema:
                type: integer
        '503':
          description: >-
            Temporarily unavailable — the request did not complete and is safe
            to retry.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/StandardAPIError'
              example:
                error:
                  code: service_unavailable
                  message: >-
                    Professional voice source audio ingestion is temporarily
                    unavailable. Retry with the same Idempotency-Key.
                  param: null
                  doc_url: null
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Optional client-supplied key for safely retrying mutations. Subsequent
        calls within 24 hours that share this key replay the original response —
        even if the request body differs slightly (a warning is logged). A retry
        that arrives while the original is still in flight gets a 409
        `request_in_progress`. Keys must be 1–255 characters from
        `[A-Za-z0-9_:.-]`; a UUID is a safe default. Scope is per-endpoint and
        per-resource: the same key on a different route or path parameter is
        independent.
      schema:
        type: string
        pattern: ^[A-Za-z0-9_\-:.]{1,255}$
        maxLength: 255
        minLength: 1
      example: 550e8400-e29b-41d4-a716-446655440000
  schemas:
    CreateAudioVoiceRequest:
      anyOf:
        - $ref: '#/components/schemas/CreateModelAudioVoiceRequest'
        - $ref: '#/components/schemas/CreateInstantAudioVoiceRequest'
        - $ref: '#/components/schemas/CreateDesignedAudioVoiceRequest'
      discriminator:
        mapping:
          design: '#/components/schemas/CreateDesignedAudioVoiceRequest'
          instant: '#/components/schemas/CreateInstantAudioVoiceRequest'
          professional: '#/components/schemas/CreateModelAudioVoiceRequest'
        propertyName: mode
    CreateModelAudioVoiceResponse:
      additionalProperties: false
      description: Identifier returned after voice creation or retraining is accepted.
      properties:
        voice_id:
          description: >-
            Stable identifier to use when retrieving the voice and its training
            status.
          title: Voice Id
          type: string
      required:
        - voice_id
      title: CreateModelAudioVoiceResponse
      type: object
    StandardAPIError:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
          example: invalid_parameter
        message:
          type: string
          description: Human-readable error message
          example: Video not found
        param:
          type:
            - string
            - 'null'
          description: Which request field caused the error
        doc_url:
          type:
            - string
            - 'null'
          description: Link to error documentation
        errors:
          type: array
          description: >-
            Per-item error details for batch/multi-node failures (e.g. graph
            compilation errors by node).
          items:
            $ref: '#/components/schemas/StandardAPIErrorDetail'
        request_id:
          type: string
          description: >-
            Request identifier, also returned in the X-HeyGen-Request-Id
            response header. Include it when contacting support.
          example: 8c4f0b9e1d2a4f6b9e3c7a1d5f2b8e40
      required:
        - code
        - message
    CreateModelAudioVoiceRequest:
      additionalProperties: false
      description: Create or retrain one model-backed audio voice.
      properties:
        mode:
          $ref: '#/components/schemas/ModelAudioVoiceMode'
          description: >-
            Required voice operation mode. Use professional to create or retrain
            a professional voice.
        voice_id:
          anyOf:
            - maxLength: 64
              minLength: 1
              pattern: ^\S+$
              type: string
            - type: 'null'
          default: null
          description: Existing professional voice to retrain. Omit to create a new voice.
          title: Voice Id
        name:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          default: null
          description: >-
            Display name for a new voice. Ignored when `voice_id` is supplied;
            the existing name is retained.
          title: Name
        language:
          anyOf:
            - maxLength: 32
              minLength: 1
              type: string
            - type: 'null'
          default: null
          description: >-
            Primary language code, such as `en`, for a new voice. Optional. When
            omitted, the language of each recording is detected during training.
            `language` is null until the voice is ACTIVE. Ignored when
            `voice_id` is supplied; the existing language is retained.
          title: Language
        audio:
          description: >-
            Source recordings of the same speaker. Each item may be a public
            HTTPS URL, a HeyGen asset ID, or base64-encoded audio. The
            recordings must contain at least 20 minutes of audio and no more
            than 1.5 GB (1,500,000,000 bytes) in total.
          items:
            discriminator:
              mapping:
                asset_id: '#/components/schemas/AssetId'
                base64: '#/components/schemas/AssetBase64'
                url: '#/components/schemas/AssetUrl'
              propertyName: type
            oneOf:
              - $ref: '#/components/schemas/AssetUrl'
              - $ref: '#/components/schemas/AssetId'
              - $ref: '#/components/schemas/AssetBase64'
          maxItems: 10
          minItems: 1
          title: Audio
          type: array
      required:
        - mode
        - audio
      title: CreateModelAudioVoiceRequest
      type: object
    CreateInstantAudioVoiceRequest:
      additionalProperties: false
      description: Create one instant voice from a single recording.
      properties:
        mode:
          const: instant
          title: Mode
          type: string
        name:
          description: Display name for the instant voice.
          maxLength: 64
          minLength: 1
          title: Name
          type: string
        language:
          anyOf:
            - maxLength: 32
              minLength: 1
              type: string
            - type: 'null'
          default: null
          description: >-
            Language code for the voice design. Omit to detect it from the
            recording.
          title: Language
        audio:
          description: >-
            A list with exactly one source recording, supplied as an audio asset
            ID, public HTTPS URL, or base64 audio. Send a list even for one
            recording, for example [{"type": "url", "url":
            "https://example.com/voice.mp3"}].
          items:
            discriminator:
              mapping:
                asset_id: '#/components/schemas/AssetId'
                base64: '#/components/schemas/AssetBase64'
                url: '#/components/schemas/AssetUrl'
              propertyName: type
            oneOf:
              - $ref: '#/components/schemas/AssetUrl'
              - $ref: '#/components/schemas/AssetId'
              - $ref: '#/components/schemas/AssetBase64'
          maxItems: 1
          minItems: 1
          title: Audio
          type: array
        remove_background_noise:
          default: true
          description: Remove background noise from the source recording before cloning.
          title: Remove Background Noise
          type: boolean
        gender:
          anyOf:
            - enum:
                - male
                - female
              type: string
            - type: 'null'
          default: null
          description: >-
            Speaker gender for default-image selection. Omit to classify the
            recording.
          title: Gender
        age:
          anyOf:
            - enum:
                - young
                - old
              type: string
            - type: 'null'
          default: null
          description: >-
            Speaker age group for default-image selection. Omit to classify the
            recording.
          title: Age
        similarity:
          default: extra_high
          description: How closely the designed voice follows the source recording.
          enum:
            - medium
            - high
            - mel
            - extra_high
            - max
          title: Similarity
          type: string
        image:
          anyOf:
            - discriminator:
                mapping:
                  asset_id: '#/components/schemas/AssetId'
                  base64: '#/components/schemas/AssetBase64'
                  url: '#/components/schemas/AssetUrl'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/AssetUrl'
                - $ref: '#/components/schemas/AssetId'
                - $ref: '#/components/schemas/AssetBase64'
            - type: 'null'
          default: null
          description: >-
            An image of the speaker in their setting, as a JPEG, PNG or WebP
            image asset ID, public HTTPS URL, or base64 image. The voice is
            conditioned on it, including the ambience its background suggests: a
            quiet room keeps the voice clean, a busy street adds matching
            background sound. Omit it to use a default image chosen from the
            speaker's gender and age. Cannot be combined with `gender` or `age`.
          title: Image
      required:
        - mode
        - name
        - audio
      title: CreateInstantAudioVoiceRequest
      type: object
    CreateDesignedAudioVoiceRequest:
      additionalProperties: false
      properties:
        description:
          description: Describe the voice's age, tone, accent, and speaking style.
          maxLength: 500
          minLength: 20
          title: Description
          type: string
        language:
          description: Language code for the designed voice, such as en or ja.
          enum:
            - ar
            - be
            - bg
            - ca
            - cs
            - da
            - de
            - el
            - en
            - es
            - fa
            - fi
            - fil
            - fr
            - he
            - hi
            - hr
            - hu
            - id
            - it
            - ja
            - ko
            - mk
            - ms
            - nl
            - pl
            - pt
            - ro
            - ru
            - sk
            - sl
            - sr
            - sv
            - ta
            - th
            - tl
            - tr
            - uk
            - vi
            - zh
          type: string
        mode:
          const: design
          description: Use design to create a HeyGen voice from a description.
          title: Mode
          type: string
        name:
          description: Display name for the new voice.
          maxLength: 64
          minLength: 1
          title: Name
          type: string
        image:
          anyOf:
            - discriminator:
                mapping:
                  asset_id: '#/components/schemas/AssetId'
                  base64: '#/components/schemas/AssetBase64'
                  url: '#/components/schemas/AssetUrl'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/AssetUrl'
                - $ref: '#/components/schemas/AssetId'
                - $ref: '#/components/schemas/AssetBase64'
            - type: 'null'
          default: null
          description: >-
            Optional JPEG, PNG, or WebP speaker image, supplied as an asset ID,
            public HTTPS URL, or base64. Conditions the HeyGen clone on the
            image.
          title: Image
      required:
        - description
        - language
        - mode
        - name
      title: CreateDesignedAudioVoiceRequest
      type: object
    StandardAPIErrorDetail:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
          example: unknown_node_type
        message:
          type: string
          description: Human-readable error message
          example: Unknown node type
        node_id:
          type: string
          description: Graph node id this error pertains to, if applicable
        port:
          type: string
          description: Port name on the node this error pertains to, if applicable
        path:
          type: string
          description: Field path within the item this error pertains to, if applicable
      required:
        - code
        - message
    ModelAudioVoiceMode:
      description: Supported audio-voice creation implementations.
      enum:
        - professional
      title: ModelAudioVoiceMode
      type: string
    AssetId:
      additionalProperties: false
      description: Asset input via HeyGen asset ID from the asset upload endpoint.
      properties:
        type:
          const: asset_id
          description: Input type discriminator
          title: Type
          type: string
        asset_id:
          description: >-
            HeyGen asset ID from an asset upload or import; not a third-party
            file ID.
          title: Asset Id
          type: string
      required:
        - type
        - asset_id
      title: AssetId
      type: object
    AssetBase64:
      additionalProperties: false
      description: Asset input via base64-encoded content.
      properties:
        type:
          const: base64
          description: Input type discriminator
          title: Type
          type: string
        media_type:
          description: MIME type of the encoded content (e.g. "image/png")
          title: Media Type
          type: string
        data:
          description: Base64-encoded file content
          title: Data
          type: string
      required:
        - type
        - media_type
        - data
      title: AssetBase64
      type: object
      x-mcp-visible: false
    AssetUrl:
      additionalProperties: false
      description: Asset input via publicly accessible HTTPS URL.
      properties:
        type:
          const: url
          description: Input type discriminator
          title: Type
          type: string
        url:
          description: >-
            Public http(s) URL HeyGen can download without auth or redirects.
            Not a local or sandbox path (/mnt/data/..., file://, sandbox:);
            upload such files and pass asset_id.
          title: Url
          type: string
      required:
        - type
        - url
      title: AssetUrl
      type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: HeyGen API key. Obtain from your HeyGen dashboard.
    BearerAuth:
      type: http
      scheme: bearer
      description: OAuth2 bearer token.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.