resolveElevenLabsVoiceId (handlers/elevenLabsVoiceMap.ts)

createworld121-afk/omniroute1 · open-sse/handlers/elevenLabsVoiceMap.ts · typescript · MIT
voice

* OpenAI-compat `voice` name -> ElevenLabs `voice_id` resolution. ElevenLabs' TTS endpoint takes a real `voice_id` (a ~20-char alphanumeric token, e.g. `21m00Tcm4TlvDq8ikWAM`) as a URL path segment. OpenAI TTS stock voice names (`alloy`, `echo`, ...) and ElevenLabs human-readable

// Source: https://github.com/createworld121-afk/omniroute1 | License: MIT | Copyright 2026 diegosouzapw
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * OpenAI-compat `voice` name -> ElevenLabs `voice_id` resolution.
 *
 * ElevenLabs' TTS endpoint takes a real `voice_id` (a ~20-char alphanumeric token, e.g.
 * `21m00Tcm4TlvDq8ikWAM`) as a URL path segment. OpenAI TTS stock voice names (`alloy`,
 * `echo`, ...) and ElevenLabs human-readable display names (`Rachel`) are not valid
 * `voice_id`s on their own — forwarding them unmapped 404s upstream. This module resolves
 * a client-supplied `voice` value to a real `voice_id`, or reports that it cannot.
 *
 * See #10589.
 */

// OpenAI TTS stock voice names -> real ElevenLabs voice_id (premade voices, widely
// availabl

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key