Overview
TheElevenLabs client class is the primary interface for interacting with the ElevenLabs API synchronously. You can instantiate multiple clients with different configurations that will propagate to all API methods.
Initialization
Parameters
str
Your ElevenLabs API key. If not provided, the client will attempt to read from the
ELEVENLABS_API_KEY environment variable.str
The base URL to use for requests from the client. Use this to override the default API endpoint.
ElevenLabsEnvironment
default:"ElevenLabsEnvironment.PRODUCTION"
The environment to use for requests from the client. Import with:
Dict[str, str]
Additional headers to send with every request.
float
default:"240"
The timeout to be used, in seconds, for requests. By default the timeout is 240 seconds, unless a custom httpx client is used, in which case this default is not enforced.
bool
default:"true"
Whether the default httpx client follows redirects or not. This is irrelevant if a custom httpx client is passed in.
httpx.Client
The httpx client to use for making requests. A preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
Properties
The client provides access to various API endpoints through properties:history
HistoryClient
text_to_speech
TextToSpeechClient
text_to_sound_effects
TextToSoundEffectsClient
text_to_dialogue
TextToDialogueClient
speech_to_speech
SpeechToSpeechClient
speech_to_text
SpeechToTextClient
text_to_voice
TextToVoiceClient
voices
VoicesClient
models
ModelsClient
user
UserClient
usage
UsageClient
samples
SamplesClient
audio_isolation
AudioIsolationClient
audio_native
AudioNativeClient
dubbing
DubbingClient
studio
StudioClient
pronunciation_dictionaries
PronunciationDictionariesClient
service_accounts
ServiceAccountsClient
webhooks
WebhooksClient
forced_alignment
ForcedAlignmentClient
conversational_ai
ConversationalAiClient
music
MusicClient
tokens
TokensClient
workspace
WorkspaceClient
with_raw_response
RawBaseElevenLabs