1. Get started

  1. Visit Pricing and select a plan
  2. For 500,000 free migration credits, email support@lmnt.com with “Migrated from ElevenLabs to LMNT” and your last ElevenLabs billing statement

2. Install SDK

pip install -U lmnt
For Unity, see the Unity SDK guide.

3. Update your code

Here’s how to convert your ElevenLabs code to LMNT.

ElevenLabs Code

import os
import uuid
from elevenlabs import VoiceSettings
from elevenlabs.client import ElevenLabs

ELEVENLABS_API_KEY = "11 LABS API KEY"
client = ElevenLabs(
   api_key=ELEVENLABS_API_KEY,
)

def text_to_speech_file(text: str) -> str:
   response = client.text_to_speech.convert(
       voice_id="pNInz6obpgDQGcFmaJgB",
       optimize_streaming_latency="0",
       output_format="mp3_22050_32",
       text=text,
       model_id="eleven_turbo_v2",
       voice_settings=VoiceSettings(
           stability=0.0,
           similarity_boost=1.0,
           style=0.0,
           use_speaker_boost=True,
       ),
   )

   save_file_path = "/Users/name/Downloads/11LABS.mp3"

   with open(save_file_path, mode = "wb") as f:
       for chunk in response:
           if chunk:
               f.write(chunk)

   print(f"{save_file_path}: A new audio file was saved successfully!")

   return save_file_path

text_to_speech_file("Hello world.")

LMNT Code

import asyncio
from lmnt import AsyncLmnt

text = 'Hello world!'
voice_id = 'leah'
language = 'en'

async def main():
  client = AsyncLmnt()
  response = await client.speech.generate(
    text=text,
    voice=voice_id,
    language=language,
  )
  with open('audio.mp3', 'wb') as f:
    f.write(await response.read())

asyncio.run(main())

4. Choose voices

Select from our stock voices or create custom voice clones in the Playground. List all available voices:
import asyncio
from lmnt import AsyncLmnt

async def main():
  client = AsyncLmnt()
  voices = await client.speech.list_voices()
  name_id_list = [(voice.name, voice.id) for voice in voices]

  for name, id_ in name_id_list:
    print(f"Name: {name} | ID: {id_}")

asyncio.run(main())

Need help?

  • Voice transfer: Email support@lmnt.com for assistance with specific voice migrations
  • Documentation: Check our guides for optimization tips