Limited-time Thanksgiving offer · 50% off platform fees for new users’ first 7 days (1.25% instead of 2.5%). Sign up by Dec 1. Sign up now → Details
Discord

Audio

Voice changer

Say something in one voice and get it back in another: same words, same delivery, a different speaker. Two endpoints:

EndpointUse it for
POST /v1/audio/voice-changerA recording of up to 5 minutes; the converted audio comes back in the response.
WS /v1/audio/voice-changer/realtimeA live microphone stream. The converted voice runs a few seconds behind the speaker.

Want to try it without code? Open Studio → Audio → Voice Change. Full parameter tables are also in the API reference.

Convert a recording

Send multipart/form-data with the audio file. The response body is the audio itself, not JSON.

import requests

with open("input.wav", "rb") as f:
    resp = requests.post(
        "https://videorouter.sh/api/v1/audio/voice-changer",
        headers={"Authorization": "Bearer llmr_sk_live_..."},
        data={"model": "eleven_multilingual_sts_v2", "voice": "adam", "response_format": "mp3"},
        files={"file": f},
        timeout=180,
    )
resp.raise_for_status()
open("converted.mp3", "wb").write(resp.content)
print("cost (USD):", resp.headers["x-llmrouter-cost-usd"])
FieldRequiredDescription
fileYeswav, mp3, m4a, flac, ogg or webm. 0.3–300 seconds, up to 25 MB.
modelNoeleven_multilingual_sts_v2 (default) or eleven_english_sts_v2.
voiceNoA voice id. Default jessica.
response_formatNomp3 (default), wav or pcm (24 kHz, 16-bit, mono).
storeNoA debugging copy of the output is kept for 30 days; false shortens that to 24 hours.

The charge for the request is in the x-llmrouter-cost-usd response header.

Real-time voice changer

Expect a delay of a few seconds. Audio is cut into clips at pauses, and each clip is converted after it ends, so a word comes out roughly one clip length plus 1–2 seconds after you say it. This suits live streams, push-to-talk and recording; it is too slow for natural two-way phone calls.

Connect with an Authorization: Bearer header from your server (browsers cannot set that header on a WebSocket, and your API key must not be shipped to one).

import asyncio, json, websockets   # pip install websockets

URL = ("wss://videorouter.sh/v1/audio/voice-changer/realtime"
       "?voice=adam&max_segment_ms=3000")

async def main(pcm: bytes):                      # 16 kHz, 16-bit, mono, little-endian
    async with websockets.connect(
        URL, additional_headers={"Authorization": "Bearer llmr_sk_live_..."}
    ) as ws:
        print(await ws.recv())                   # session.ready

        async def send():
            for i in range(0, len(pcm), 3200):   # 100 ms frames, at microphone speed
                await ws.send(pcm[i:i + 3200])
                await asyncio.sleep(0.1)
            await ws.send(json.dumps({"type": "end"}))

        sender = asyncio.create_task(send())
        with open("converted.pcm", "wb") as out:
            async for msg in ws:
                if isinstance(msg, bytes):
                    out.write(msg)               # same PCM format as the input
                else:
                    print(msg)                   # segment.done ... session.done
        await sender

asyncio.run(main(open("input.pcm", "rb").read()))
Query parameterDefaultDescription
modelmultilingualSame ids as above.
voicejessicaA voice id.
max_segment_ms30001000–8000. The longest clip. Lower values reduce the delay but give the model less context.

Protocol

DirectionFrameMeaning
Server{"type":"session.ready", ...}Start sending audio.
Clientbinary16 kHz, 16-bit, mono, little-endian PCM. At most 64 KB per frame.
ServerbinaryConverted audio in the same format, in order. Quiet stretches come back as silence.
Server{"type":"segment.done", ...}One converted clip: seq, input_seconds, processing_ms.
Client{"type":"end"}No more audio; convert what is left.
Server{"type":"session.done", ...}billed_input_seconds, cost_usd, trace_id. The socket then closes.
Server{"type":"error", ...}code and message, followed by a close.
Close codeMeaning
1000Finished normally.
4400Bad parameter, unknown voice or model, or an invalid frame.
4401Missing or invalid API key.
4402Not enough credits, or a spend cap was reached.
4403This key may not call the endpoint.
440860 seconds without audio, or the 30-minute session limit.
4429Rate limit, no free real-time slot, or your organization already has a session open.
4502The provider failed on a clip. That clip is not charged.
4503The voice changer is temporarily unavailable.

Voices

Pass the id as voice. Community voices are characters from the provider's shared voice library and may be withdrawn by their authors.

Voice idNameGenderStyleSourceSample
jessicaJessicaFemaleAmerican, Playful, Bright, WarmOfficial
sarahSarahFemaleAmerican, Mature, Reassuring, ConfidentOfficial
adamAdamMaleAmerican, Dominant, FirmOfficial
brianBrianMaleAmerican, Deep, Resonant and ComfortingOfficial
aliceAliceFemaleBritish, Clear, Engaging EducatorOfficial
bellaBellaFemaleAmerican, Professional, Bright, WarmOfficial
billBillMaleAmerican, Wise, Mature, BalancedOfficial
callumCallumMaleAmerican, Husky TricksterOfficial
charlieCharlieMaleAustralian, Deep, Confident, EnergeticOfficial
chrisChrisMaleAmerican, Charming, Down-to-EarthOfficial
danielDanielMaleBritish, Steady BroadcasterOfficial
ericEricMaleAmerican, Smooth, TrustworthyOfficial
georgeGeorgeMaleBritish, Warm, Captivating StorytellerOfficial
harryHarryMaleAmerican, Fierce WarriorOfficial
lauraLauraFemaleAmerican, Enthusiast, Quirky AttitudeOfficial
liamLiamMaleAmerican, Energetic, Social Media CreatorOfficial
lilyLilyFemaleBritish, Velvety ActressOfficial
matildaMatildaFemaleAmerican, Knowledgable, ProfessionalOfficial
riverRiverNeutralAmerican, Relaxed, Neutral, InformativeOfficial
rogerRogerMaleAmerican, Laid-Back, Casual, ResonantOfficial
willWillMaleAmerican, Relaxed OptimistOfficial
wizardGrumpy WizardMaleBritish, Gruff, grandfatherlyCommunity
detectiveNoir DetectiveMaleSmoky, noirCommunity
fairyLittle FairyFemaleUkrainian, Soft, whimsicalCommunity
valley-girlValley GirlFemaleAmerican, Bubbly, playfulCommunity
piratePirateMaleIrish, Rugged, adventurousCommunity
robotRobot HelperFemaleAmerican, Futuristic assistantCommunity
evil-queenEvil QueenFemaleAmerican, Dark, regalCommunity
trailerTrailer VoiceMaleAmerican, Deep, epicCommunity

Create and share your own voice

Custom voices are created in Studio → Audio → Voice Change → Create Voice. There is no API for creating them yet.

  • Upload or record a sample: 10 seconds to 2 minutes of one person speaking clearly, without music.
  • You must confirm that it is your own voice, or that you have the speaker's permission. Voices of public figures are not allowed.
  • The voice is private to your organization. Open its menu to find its vc_… id, then pass that as voice to either endpoint.
  • If you choose to share it, we review it first. Once approved, other users can hear your sample and use the voice. You can stop sharing or delete it at any time, which ends their access.
  • Each organization can keep up to 3 custom voices, and total capacity is limited.

Creating a voice is free; converting audio with it is billed like any other voice.

Pricing and limits

ModelLanguagesPrice
eleven_multilingual_sts_v2Multilingual$0.12 per minute of input audio, plus the platform fee
eleven_english_sts_v2English only$0.12 per minute of input audio, plus the platform fee
  • The charge follows the provider's own metering of each request. If it cannot be verified, you are not charged and no audio is returned.
  • A real-time session is billed once, when it ends, for every clip the provider converted, including clips still being converted if you disconnect. Send {"type":"end"} to receive them. Silence is free. Credit is held while the session runs.
  • Real-time capacity is small: one open session per organization, 30 minutes per session.

Current prices are also listed on the models page and returned by GET /v1/models?type=voice_changer.

Errors (recordings)

StatusWhen
400Unreadable file, wrong length or size, unknown voice, model or format.
401Missing or invalid API key.
402Not enough credits.
429Rate limit.
502The provider failed, or its charge could not be verified. You are not charged.
503The voice changer is temporarily unavailable.