aura 2
Model Overview
Aura 2 produces natural, human-like speech with accurate domain-specific pronunciation — covering drug names, legal terms, alphanumeric strings, and structured inputs such as dates, times, and currency. It also maintains sub-200 ms TTFB latency and offers cost-efficient scalability.
Setup your API Key
If you don’t have an API key for the AI/ML API yet, feel free to use our Quickstart guide.
Code Example
import os
import requests
def main():
url = "https://api.aimlapi.com/v1/tts"
headers = {
# Insert your AI/ML API key instead of <YOUR_AIMLAPI_KEY>:
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
}
payload = {
"model": "#g1_aura-2-helena-en",
"text": '''
Cities of the future promise to radically transform how people live, work, and move.
Instead of sprawling layouts, we’ll see vertical structures that integrate residential, work, and public spaces into single, self-sustaining ecosystems.
Architecture will adapt to climate conditions, and buildings will be energy-efficient—generating power through solar panels, wind turbines, and even foot traffic.
'''
}
response = requests.post(url, headers=headers, json=payload, stream=True)
# result = os.path.join(os.path.dirname(__file__), "audio.wav") # if you run this code as a .py file
result = "audio.wav" # if you run this code in Jupyter Notebook
with open(result, "wb") as write_stream:
for chunk in response.iter_content(chunk_size=8192):
if chunk:
write_stream.write(chunk)
print("Audio saved to:", result)
main()const https = require("https");
const fs = require("fs");
// Insert your AI/ML API key instead of <YOUR_AIMLAPI_KEY>:
const apiKey = "<YOUR_AIMLAPI_KEY>";
const data = JSON.stringify({
model: "#g1_aura-2-helena-en",
text: `
Cities of the future promise to radically transform how people live, work, and move.
Instead of sprawling layouts, we’ll see vertical structures that integrate residential, work, and public spaces into single, self-sustaining ecosystems.
Architecture will adapt to climate conditions, and buildings will be energy-efficient—generating power through solar panels, wind turbines, and even foot traffic.
`
});
const options = {
hostname: "api.aimlapi.com",
path: "/v1/tts",
method: "POST",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json",
"Content-Length": Buffer.byteLength(data),
}
};
const req = https.request(options, (res) => {
if (res.statusCode >= 400) {
let error = "";
res.on("data", chunk => error += chunk);
res.on("end", () => {
console.error(`Error ${res.statusCode}:`, error);
});
return;
}
const file = fs.createWriteStream("audio.wav");
res.pipe(file);
file.on("finish", () => {
file.close();
console.log("Audio saved to audio.wav");
});
});
req.on("error", (e) => {
console.error("Request error:", e);
});
req.write(data);
req.end();The generated audio: WAV.
API Schema
post
Authorizations
Body
modelundefined · enumRequiredPossible values:
textstringRequired
The text content to be converted to speech.
containerstringOptional
The file format wrapper for the output audio. The available options depend on the encoding type.
encodingstring · enumOptionalDefault:
Specifies the expected encoding of your audio output
linear16Possible values: sample_ratestringOptional
Audio sample rate in Hz.
Responses
201Success
application/json
post
/v1/ttsPOST /v1/tts HTTP/1.1
Host: api.aimlapi.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 110
{
"model": "#g1_aura-2-amalthea-en",
"text": "text",
"container": "text",
"encoding": "linear16",
"sample_rate": "text"
}201Success
{
"metadata": {
"transaction_key": "text",
"request_id": "text",
"sha256": "text",
"created": "2025-11-02T17:06:33.714Z",
"duration": 1,
"channels": 1,
"models": [
"text"
],
"model_info": {
"ANY_ADDITIONAL_PROPERTY": {
"name": "text",
"version": "text",
"arch": "text"
}
}
}
}Last updated
Was this helpful?