v3_alpha
How to Make a Call
Quick Code Example
import os
import request
def main():
url = "https://api.aimlapi.com/v1/tts"
headers = {
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
}
payload = {
"model": "elevenlabs/v3_alpha",
"text": "Hi! What are you doing today?",
"voice": "Alice"
}
response = requests.post(url, headers=headers, json=payload, stream=True)
dist = os.path.abspath("audio.wav")
with open(dist, "wb") as write_stream:
for chunk in response.iter_content(chunk_size=8192):
if chunk:
write_stream.write(chunk)
print("Audio saved to:", dist)
main()API Schemas
Bearer key
The text content to be converted to speech.
Name of the voice to be used.
RachelPossible values: This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped.
Format of the output content for non-streaming requests. Controls how the generated audio data is encoded in the response.
If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed.
Last updated
Was this helpful?