#Hello Hope everyone is living well Any

1 messages · Page 1 of 1 (latest)

weak sail
late shell
#

Use this code to get all the voices:

import requests
import json

XI_API_KEY = "<xi-api-key>"

url = "https://api.elevenlabs.io/v1/voices"

headers = {
  "Accept": "application/json",
  "xi-api-key": XI_API_KEY
}

response = requests.get(url, headers=headers)

# Parse the JSON response
data = response.json()

# Loop through each voice in the response
for voice in data['voices']:
    # Print the 'name' and 'voice_id' in the required format
    print(f"{voice['name']}; {voice['voice_id']}")
#

Replace <xi-api-key> with your actual API key and you should get a list of all the voices in your account and the voice_id

somber gull
#

Click on "Try it out" and insert your API Key

weak sail
#

Beast! Code worked 🙏

late shell
# weak sail Beast! Code worked 🙏

Glad to hear it! It is not the same. This is your unique voice_id I belive. Since the voice is copied into your library, it also gets its own id.

weak sail
#

Ah, that makes sense, appreciate the time