> ## 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.

# Lightning v3.1

> Get speech for given text using the Lightning v3.1 model

## Overview

Lightning v3.1 is a 44 kHz text-to-speech model that delivers natural, expressive, and realistic speech synthesis.

## Key Features

* **Voice Cloning Support**: Compatible with cloned voices
* **Ultra-Low Latency**: Optimized for real-time applications
* **Multi-Language**: Supports English (en) and Hindi (hi)
* **Multiple Output Formats**: PCM, MP3, WAV, and mulaw
* **Flexible Sample Rates**: 8000 Hz to 44100 Hz
* **Speed Control**: Adjustable from 0.5x to 2x speed


## OpenAPI

````yaml POST /waves/v1/lightning-v3.1/get_speech
openapi: 3.0.1
info:
  title: Text-to-Speech API
  description: |
    API for Waves text-to-speech models.
    Featuring Lightning v2 and Lightning v3.1 models.
  version: 1.0.0
servers:
  - url: https://api.smallest.ai
    description: Waves API server
security: []
paths:
  /waves/v1/lightning-v3.1/get_speech:
    post:
      tags:
        - Lightning V3.1
      summary: Generate speech from text (Lightning V3.1)
      description: Converts provided text to speech using the Lightning V3.1 model.
      operationId: synthesizeLightningV31Speech
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LightningV31Request'
      responses:
        '200':
          description: Synthesized speech retrieved successfully.
          content:
            audio/wav:
              schema:
                type: string
                format: binary
                description: A PCM int16 WAV file at the specified sample rate.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: InvalidRequest
                message: The 'text' field is required.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Unauthorized
                message: Bearer token is missing or invalid.
        '500':
          description: Server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: InternalServerError
                message: An unexpected error occurred.
      security:
        - bearerAuth: []
components:
  schemas:
    LightningV31Request:
      type: object
      required:
        - text
        - voice_id
      properties:
        text:
          type: string
          description: The text to convert to speech.
        voice_id:
          type: string
          description: The voice identifier to use for speech generation.
        sample_rate:
          type: integer
          description: The sample rate for the generated audio.
          enum:
            - 8000
            - 16000
            - 24000
            - 44100
          default: 44100
        speed:
          type: number
          description: The speed of the generated speech.
          minimum: 0.5
          maximum: 2
          default: 1
        language:
          type: string
          description: >-
            Language code for text normalization (e.g., how numbers, dates, and
            abbreviations are spelled out). Set to 'auto' for automatic language
            detection, or specify a language code like 'en' or 'hi'.
          default: auto
          enum:
            - auto
            - en
            - hi
            - ta
            - es
        output_format:
          type: string
          description: The format of the output audio.
          default: pcm
          enum:
            - pcm
            - mp3
            - wav
            - mulaw
        pronunciation_dicts:
          type: array
          items:
            type: string
            description: >-
              The ID of the pronunciation dictionary to use for speech
              generation.
          description: >-
            The IDs of the pronunciation dictionaries to use for speech
            generation.
    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.

````