> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs-beta-7agmae.voicedub.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create new dub

> Create a new dub by providing a voice ID and either a link or uploading audio. Returns upload URL if no link provided. Dubs are currently limited to 30 minutes.



## OpenAPI

````yaml post /v1/me/dubs
openapi: 3.1.0
info:
  title: VoiceDub API
  description: API for creating AI voice dubs and training custom voice models
  version: 1.0.0
  contact:
    name: VoiceDub Support
    email: help@voicedub.ai
    url: https://voicedub.ai
servers:
  - url: https://api.voicedub.ai
    description: Production server
security:
  - apiKeyAuth: []
tags:
  - name: Dubs
    description: Operations for creating and managing voice dubs
  - name: Voices
    description: Operations for creating and managing voice models
  - name: User
    description: Operations for managing user account and settings
paths:
  /v1/me/dubs:
    post:
      tags:
        - Dubs
      summary: Create new dub
      description: >-
        Create a new dub by providing a voice ID and either a link or uploading
        audio. Returns upload URL if no link provided. Dubs are currently
        limited to 30 minutes.
      operationId: createDub
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDubRequest'
      responses:
        '200':
          description: Dub created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDubResponse'
        '400':
          description: Bad request - voice not found or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DubVoiceNotFoundError'
components:
  schemas:
    CreateDubRequest:
      type: object
      properties:
        voiceId:
          type: string
          format: uuid
          description: UUID of the voice model to use for dubbing
          example: 123e4567-e89b-12d3-a456-426614174001
        link:
          type: string
          format: uri
          description: URL of audio/video to dub (alternative to file upload)
          example: https://example.com/audio.mp3
        pitchShift:
          type: integer
          minimum: -24
          maximum: 24
          default: 0
          description: Pitch shift in semitones (-24 to +24)
          example: 0
        separate:
          type: boolean
          default: true
          description: Whether to separate vocals from backing track
          example: true
      required:
        - voiceId
    CreateDubResponse:
      type: object
      properties:
        dub:
          type: object
          properties:
            id:
              type: string
              format: uuid
              description: Unique identifier for the dub
              example: 123e4567-e89b-12d3-a456-426614174000
            voiceId:
              type:
                - string
                - 'null'
              format: uuid
              description: Voice model used for the dub
              example: 123e4567-e89b-12d3-a456-426614174001
            link:
              type:
                - string
                - 'null'
              description: Original audio/video link if provided (null if not provided)
              example: https://example.com/audio.mp3
            separate:
              type: boolean
              description: Whether vocals were separated from backing track
              example: true
            status:
              type: string
              enum:
                - new
                - preprocessing
                - preprocessed
                - queued
                - starting
                - processing
                - finalizing
                - done
                - error
              description: Current processing status of the dub
              example: new
              openapi:
                description: Current processing status of the dub
                example: done
            inputDuration:
              type:
                - integer
                - 'null'
              description: >-
                Duration of input audio in milliseconds (null before
                preprocessed)
              example: null
              openapi:
                description: >-
                  Duration of input audio in milliseconds (null before
                  preprocessed)
                example: 180000
            inputSource:
              type: string
              enum:
                - upload
                - link
              description: Source type of the input audio
              example: upload
            pitchShift:
              type: integer
              description: Pitch shift applied in semitones
              example: 0
            errorCode:
              type:
                - string
                - 'null'
              description: Error code if processing failed (null for now)
              example: null
            errorMessage:
              type:
                - string
                - 'null'
              description: Error message if processing failed (null for now)
              example: null
            apiCreditsUsed:
              type: integer
              description: API credits consumed for this dub (0 before /generate is called)
              example: 0
              openapi:
                description: >-
                  API credits consumed for this dub (0 before /generate is
                  called)
                example: 30
            apiCreditsLeft:
              type:
                - integer
                - 'null'
              description: >-
                Remaining API credits after this dub (null before /generate is
                called)
              example: null
              openapi:
                description: >-
                  Remaining API credits after this dub (null before /generate is
                  called)
                example: 90
            completedAt:
              type:
                - string
                - 'null'
              description: >-
                Timestamp when dub processing completed (null if status is not
                "done" or "error")
              example: null
              openapi:
                description: >-
                  Timestamp when dub processing completed (null if status is not
                  "done" or "error")
                example: '2024-01-15T10:30:00.000Z'
            createdAt:
              type: string
              description: Timestamp when dub was created
              example: '2024-01-15T10:00:00.000Z'
            updatedAt:
              type: string
              description: Timestamp when dub was last updated
              example: '2024-01-15T10:30:00.000Z'
            dubUrl:
              type:
                - string
                - 'null'
              default: null
              description: Download URL for the completed dub (null if status is not done)
              example: null
              openapi:
                description: >-
                  Download URL for the completed dub (null if status is not
                  done)
                example: >-
                  https://example.com/dubs/123e4567-e89b-12d3-a456-426614174000.mp3
            requiredCredits:
              type:
                - number
                - 'null'
              default: null
              description: >-
                Number of credits required to process this dub (null before
                preprocessed)
              example: null
              openapi:
                description: >-
                  Number of credits required to process this dub (null before
                  preprocessed)
                example: 30
          required:
            - id
            - voiceId
            - link
            - separate
            - status
            - inputDuration
            - inputSource
            - pitchShift
            - errorCode
            - errorMessage
            - apiCreditsUsed
            - apiCreditsLeft
            - completedAt
            - createdAt
            - updatedAt
            - dubUrl
            - requiredCredits
        uploadUrl:
          type:
            - string
            - 'null'
          format: uri
          description: Presigned URL for uploading audio file (only when link not provided)
          example: >-
            https://s3.amazonaws.com/bucket/uploads/123e4567-e89b-12d3-a456-426614174000?X-Amz-Signature=...
      required:
        - dub
        - uploadUrl
    DubVoiceNotFoundError:
      type: object
      properties:
        code:
          type: string
          const: voice_not_found
          description: Error code
          example: voice_not_found
        message:
          type: string
          description: Human-readable error message
          example: Voice not found or not accessible
      required:
        - code
        - message
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key in the format: "Api-Key <your-api-key>"'

````