Audio
Voice changer
Say something in one voice and get it back in another: same words, same delivery, a different speaker. Two endpoints:
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"])
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.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
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()))
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
{"type":"session.ready", ...}Start sending audio.{"type":"segment.done", ...}One converted clip: seq, input_seconds, processing_ms.{"type":"end"}No more audio; convert what is left.{"type":"session.done", ...}billed_input_seconds, cost_usd, trace_id. The socket then closes.{"type":"error", ...}code and message, followed by a close.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.
jessicaJessicaFemaleAmerican, Playful, Bright, WarmOfficialsarahSarahFemaleAmerican, Mature, Reassuring, ConfidentOfficialadamAdamMaleAmerican, Dominant, FirmOfficialbrianBrianMaleAmerican, Deep, Resonant and ComfortingOfficialaliceAliceFemaleBritish, Clear, Engaging EducatorOfficialbellaBellaFemaleAmerican, Professional, Bright, WarmOfficialbillBillMaleAmerican, Wise, Mature, BalancedOfficialcallumCallumMaleAmerican, Husky TricksterOfficialcharlieCharlieMaleAustralian, Deep, Confident, EnergeticOfficialchrisChrisMaleAmerican, Charming, Down-to-EarthOfficialdanielDanielMaleBritish, Steady BroadcasterOfficialericEricMaleAmerican, Smooth, TrustworthyOfficialgeorgeGeorgeMaleBritish, Warm, Captivating StorytellerOfficialharryHarryMaleAmerican, Fierce WarriorOfficiallauraLauraFemaleAmerican, Enthusiast, Quirky AttitudeOfficialliamLiamMaleAmerican, Energetic, Social Media CreatorOfficiallilyLilyFemaleBritish, Velvety ActressOfficialmatildaMatildaFemaleAmerican, Knowledgable, ProfessionalOfficialriverRiverNeutralAmerican, Relaxed, Neutral, InformativeOfficialrogerRogerMaleAmerican, Laid-Back, Casual, ResonantOfficialwillWillMaleAmerican, Relaxed OptimistOfficialwizardGrumpy WizardMaleBritish, Gruff, grandfatherlyCommunitydetectiveNoir DetectiveMaleSmoky, noirCommunityfairyLittle FairyFemaleUkrainian, Soft, whimsicalCommunityvalley-girlValley GirlFemaleAmerican, Bubbly, playfulCommunitypiratePirateMaleIrish, Rugged, adventurousCommunityrobotRobot HelperFemaleAmerican, Futuristic assistantCommunityevil-queenEvil QueenFemaleAmerican, Dark, regalCommunitytrailerTrailer VoiceMaleAmerican, Deep, epicCommunityCreate 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 asvoiceto 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
eleven_multilingual_sts_v2Multilingual$0.12 per minute of input audio, plus the platform feeeleven_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)
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.