Skip to main content

Listing ElevenLabs Voices

Sunra exposes a lightweight helper endpoint that lets you discover the voices available on the shared ElevenLabs account that powers our ElevenLabs TTS models. The endpoint does not run an inference pipeline — there is no billing, no prediction record, no queue. It is a direct, paginated lookup against the upstream ElevenLabs voice library. Once you find a voice you like, plug its voice_id into the custom_voice_id field of any ElevenLabs TTS model and the model will use that voice instead of its default.

Endpoint

GET https://api.sunra.ai/v1/elevenlabs/voices
Authentication is the same as the rest of the Sunra API — send your API key in the Authorization header.

Query parameters

All parameters are optional.
ParameterType / valuesDefaultDescription
page_sizeinteger (max 100)10How many voices to return in one response.
searchstringFilter by name, description, labels, or category.
sort_byname | dateField to sort by. date sorts by voice creation time.
sort_directionasc | descSort order.
categorypremade | cloned | generated | professionalVoice category.
voice_typepersonal | community | default | workspace | non-default | non-community | savedVoice ownership / source.
next_page_tokenstringPagination token returned by a previous response.

Response

{
  "voices": [
    {
      "voice_id": "9BWtsMINqrJLrRacOk9x",
      "name": "Aria",
      "settings": null
    },
    {
      "voice_id": "CwhRBWXzGAHq8TQ4Fs17",
      "name": "Roger",
      "settings": null
    }
  ],
  "has_more": true,
  "next_page_token": "RVhBVklUUXU0dnI0eG5TRHhNYUx8"
}
FieldDescription
voices[].voice_idThe ID to pass as custom_voice_id to a TTS model.
voices[].nameHuman-readable voice name.
voices[].settingsDefault voice settings (stability, similarity_boost, etc.) or null if none are saved on the voice.
has_moretrue while more pages remain.
next_page_tokenPass this as next_page_token in the next call to fetch the next page. null on the last page.

Pagination

Drive pagination from has_more and next_page_token. Keep calling the endpoint with the previous response’s next_page_token until has_more is false:
let token = undefined;
const all = [];

do {
  const url = new URL("https://api.sunra.ai/v1/elevenlabs/voices");
  url.searchParams.set("page_size", "100");
  if (token) url.searchParams.set("next_page_token", token);

  const resp = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.SUNRA_KEY}` },
  });
  const body = await resp.json();
  all.push(...body.voices);
  token = body.has_more ? body.next_page_token : null;
} while (token);

Examples

curl -H "Authorization: Bearer $SUNRA_KEY" \
  "https://api.sunra.ai/v1/elevenlabs/voices?category=premade&sort_by=date&sort_direction=desc&page_size=20"

Using a voice in a TTS model

Take any voice_id from the response and pass it as custom_voice_id when calling an ElevenLabs TTS endpoint. When custom_voice_id is set it overrides the model’s default voice field, so you can use any voice the account has access to — including cloned voices and voices saved from the ElevenLabs voice library, not just the defaults exposed by the schema’s voice enum. This works for every Sunra ElevenLabs TTS endpoint:
  • elevenlabs/eleven-v3/text-to-speech
  • elevenlabs/multilingual-v2/text-to-speech
  • elevenlabs/turbo-v2.5/text-to-speech
  • elevenlabs/multilingual-sts-v2/speech-to-speech
import { sunra } from "@sunra/client";

const result = await sunra.subscribe(
  "elevenlabs/multilingual-v2/text-to-speech",
  {
    input: {
      text: "Welcome to Sunra.",
      custom_voice_id: "9BWtsMINqrJLrRacOk9x",
    },
  }
);
import sunra_client

result = sunra_client.subscribe(
    "elevenlabs/multilingual-v2/text-to-speech",
    arguments={
        "text": "Welcome to Sunra.",
        "custom_voice_id": "9BWtsMINqrJLrRacOk9x",
    },
)