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

# Upload a voice sample

> Upload a voice sample to create a new voice prompt in the voice bank. The audio data must be base64-encoded. Maximum file size is 20 MB.



## OpenAPI

````yaml post /voice
openapi: 3.0.0
info:
  title: Deepdub API
  description: >-
    Deepdub's Text-to-Speech API enables high-quality, expressive speech
    generation with voice cloning, accent control, and real-time streaming
    capabilities.
  contact:
    email: support@deepdub.ai
  version: '1.0'
servers:
  - url: https://restapi.deepdub.ai/api/v1
    description: Production
security:
  - ApiKeyAuth: []
externalDocs:
  description: OpenAPI
  url: https://restapi.deepdub.ai/api/v1/swagger/index.html
paths:
  /voice:
    post:
      tags:
        - Voice
      summary: Upload a voice sample
      description: >-
        Upload a voice sample to create a new voice prompt in the voice bank.
        The audio data must be base64-encoded. Maximum file size is 20 MB.
      operationId: createVoicePrompt
      parameters:
        - description: API Key
          name: x-api-key
          in: header
          required: true
          schema:
            type: string
            default: dd-00000000000000000000000065c9cbfe
          example: dd-00000000000000000000000065c9cbfe
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/model.VoiceBankAPIRequest'
        description: >-
          Voice upload request. Audio data must be base64-encoded and not exceed
          20 MB.
        required: true
      responses:
        '200':
          description: Voice prompt created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  response:
                    $ref: '#/components/schemas/model.VoiceBankAPIResponse'
        '400':
          description: >-
            Bad request — invalid audio data, missing fields, or file exceeds 20
            MB limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/model.APIError'
              example:
                success: false
                message: Audio data exceeds 20 MB limit
        '401':
          description: Unauthorized — invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/model.APIError'
              example:
                success: false
                message: 'Unauthorized: invalid or missing API key'
        '403':
          description: Forbidden — voice prompt limit reached for your account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/model.APIError'
              example:
                success: false
                message: Voice prompt limit reached for your account
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/model.APIError'
              example:
                success: false
                message: Internal server error
components:
  schemas:
    model.VoiceBankAPIRequest:
      description: Request to upload a voice sample and create a voice prompt
      type: object
      required:
        - filename
        - data
      properties:
        filename:
          description: Name of the audio file being uploaded
          type: string
          example: voice_sample.wav
        data:
          description: Base64-encoded audio data
          type: string
        title:
          description: Title for the voice prompt
          type: string
          example: Professional Narrator
        text:
          description: Transcript of the spoken text in the audio sample
          type: string
          example: This is a sample recording for voice cloning.
        locale:
          description: Language locale code of the voice sample
          type: string
          example: en-US
        gender:
          description: Gender of the speaker
          type: string
          enum:
            - MALE
            - FEMALE
            - NON_BINARY
          example: FEMALE
        age:
          description: Age of the speaker
          type: integer
          example: 35
        speaking_style:
          description: Speaking style descriptor
          type: string
          example: narrative
        speaker_id:
          description: Optional external speaker identifier
          type: string
        publish:
          description: Whether to make the voice prompt publicly available
          type: boolean
          example: false
    model.VoiceBankAPIResponse:
      description: Response after creating or deleting a voice prompt
      type: object
      properties:
        voice_prompt_id:
          description: Unique identifier of the created/affected voice prompt
          type: string
          example: vp_12345abcde
    model.APIError:
      description: Error response returned for all non-2xx status codes
      type: object
      required:
        - success
        - message
      properties:
        success:
          description: Always false for error responses
          type: boolean
          example: false
        message:
          description: Human-readable error message
          type: string
          example: Invalid request parameters
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Must start with `dd-` prefix.

````