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

# Add your Voice

> Add your voice using the Waves API.

> **Note:** The Mintlify web UI currently does not correctly upload files in the API request. Below, we have provided code examples in Python and curl to help you test the API.

## Sample cURL Example

```bash theme={null}
curl -X POST https://api.smallest.ai/waves/v1/lightning-large/add_voice \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "displayName=my voice" \
    -F "file=@my_voice.wav;type=audio/wav"
```

## Sample Code Example

Here is a Python example using the `requests` library:

<CodeGroup>
  ```python python theme={null}
  import requests
  url = "https://api.smallest.ai/waves/v1/lightning-large/add_voice"
  payload = {'displayName': 'my voice'}
  files=[
    ('file', ('my_voice.wav', open('my_voice.wav','rb'), 'audio/wav'))
  ]
  headers = {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
  response = requests.request("POST", url, headers=headers, data=payload, files=files)
  print(response.text)
  ```
</CodeGroup>

Replace `YOUR_API_KEY` with your actual API key and `example.wav` with the path to your audio file.


## OpenAPI

````yaml POST /waves/v1/lightning-large/add_voice
openapi: 3.0.1
info:
  title: Voices API
  description: |
    API for managing voices in Waves.
    Get available voices, clone voices, and manage your voice library.
  version: 1.0.0
servers:
  - url: https://api.smallest.ai
    description: Waves API server
security: []
paths:
  /waves/v1/lightning-large/add_voice:
    post:
      tags:
        - Voice Cloning
      summary: Add a new voice to the model
      description: >-
        Instantly clone a voice by uploading an audio file for the specified
        model.
      operationId: addVoiceToModel
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                displayName:
                  type: string
                  description: Display name for the voice clone.
                file:
                  type: string
                  format: binary
                  description: Audio file to create voice clone from.
              required:
                - displayName
                - file
      responses:
        '200':
          description: Voice clone created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Message if the voice clone was created successfully.
                  data:
                    type: object
                    properties:
                      voiceId:
                        type: string
                        description: Unique Voice ID.
                      model:
                        type: string
                        description: Model used to generate the voice.
                      status:
                        type: string
                        description: Status of the voice creation.
                    required:
                      - voiceId
                      - model
                      - status
        '400':
          description: Bad request or limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error occurred
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error type
        message:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <api_key>`, where
        <api_key> is your api key.

````