Skip to content

Commit

Permalink
(chore): document api_key kwarg (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-bot authored Feb 20, 2024
1 parent d0a1b62 commit 5da7c7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ We support two main models: the newest `eleven_multilingual_v2`, a single founda
from elevenlabs import generate, play

audio = generate(
# api_key="YOUR_API_KEY", (Defaults to os.getenv(ELEVEN_API_KEY))
text="Hello! 你好! Hola! नमस्ते! Bonjour! こんにちは! مرحبا! 안녕하세요! Ciao! Cześć! Привіт! வணக்கம்!",
voice="Rachel",
model="eleven_multilingual_v2"
Expand Down Expand Up @@ -153,6 +154,7 @@ Clone your voice in an instant. Note that voice cloning requires an API key, see
from elevenlabs import clone, generate, play

voice = clone(
# api_key="YOUR_API_KEY", (Defaults to os.getenv(ELEVEN_API_KEY))
name="Alex",
description="An old American male voice with a slight hoarseness in his throat. Perfect for news", # Optional
files=["./sample_0.mp3", "./sample_1.mp3", "./sample_2.mp3"],
Expand All @@ -171,6 +173,7 @@ Stream audio in real-time, as it's being generated.
from elevenlabs import generate, stream

audio_stream = generate(
# api_key="YOUR_API_KEY", (Defaults to os.getenv(ELEVEN_API_KEY))
text="This is a... streaming voice!!",
stream=True
)
Expand All @@ -188,6 +191,7 @@ def text_stream():
yield "I'm a text to speech API "

audio_stream = generate(
# api_key="YOUR_API_KEY", (Defaults to os.getenv(ELEVEN_API_KEY))
text=text_stream(),
voice="Nicole",
model="eleven_monolingual_v1",
Expand Down

0 comments on commit 5da7c7e

Please sign in to comment.