Guides
Audio Generation
Synthesize speech and generate music with the AirCube API.
Available audio models
Text-to-speech
| Model slug | Display name | Tasks |
|---|---|---|
eleven-v3 | ElevenLabs v3 | text-to-speech |
qwen3-tts | Qwen3 TTS | text-to-speech |
Text-to-music
| Model slug | Display name | Tasks |
|---|---|---|
music-2.5 | MiniMax Music 2.5 | text-to-music |
For the full list, see the model catalog.
Text to speech
Generate natural-sounding speech from text.
cURL
curl -X POST https://aircube.ai/api/v3/eleven-v3/text-to-speech \
-H "Authorization: Bearer $AIRCUBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Hello! Welcome to AirCube, the unified API for AI generation."
}'Python
import os
import time
import requests
API_KEY = os.environ["AIRCUBE_API_KEY"]
BASE_URL = "https://aircube.ai/api/v3"
HEADERS = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
# Submit
response = requests.post(
f"{BASE_URL}/eleven-v3/text-to-speech",
headers=HEADERS,
json={
"prompt": "Hello! Welcome to AirCube, the unified API for AI generation.",
},
)
generation_id = response.json()["data"]["id"]
# Poll
while True:
result = requests.get(f"{BASE_URL}/status/{generation_id}", headers=HEADERS).json()
if result["data"]["status"] == "completed":
print(result["data"]["output_url"])
break
elif result["data"]["status"] == "failed":
print("Failed")
break
time.sleep(3)JavaScript
const API_KEY = process.env.AIRCUBE_API_KEY;
const BASE_URL = "https://aircube.ai/api/v3";
const submitRes = await fetch(`${BASE_URL}/eleven-v3/text-to-speech`, {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "Hello! Welcome to AirCube, the unified API for AI generation.",
}),
});
const { data } = await submitRes.json();
while (true) {
const pollRes = await fetch(`${BASE_URL}/status/${data.id}`, {
headers: { Authorization: `Bearer ${API_KEY}` },
});
const result = await pollRes.json();
if (result.data.status === "completed") {
console.log(result.data.output_url);
break;
} else if (result.data.status === "failed") {
throw new Error("Failed");
}
await new Promise((r) => setTimeout(r, 3000));
}Text to music
Generate music from a text description.
cURL
curl -X POST https://aircube.ai/api/v3/music-2.5/text-to-music \
-H "Authorization: Bearer $AIRCUBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "upbeat electronic lo-fi beat with soft piano chords, 120 BPM"
}'Python
response = requests.post(
f"{BASE_URL}/music-2.5/text-to-music",
headers=HEADERS,
json={
"prompt": "upbeat electronic lo-fi beat with soft piano chords, 120 BPM",
},
)
generation_id = response.json()["data"]["id"]
while True:
result = requests.get(f"{BASE_URL}/status/{generation_id}", headers=HEADERS).json()
if result["data"]["status"] == "completed":
print(result["data"]["output_url"])
break
elif result["data"]["status"] == "failed":
print("Failed")
break
time.sleep(3)JavaScript
const submitRes = await fetch(`${BASE_URL}/music-2.5/text-to-music`, {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "upbeat electronic lo-fi beat with soft piano chords, 120 BPM",
}),
});Parameters
voice
For text-to-speech models, you can specify a voice ID:
{
"prompt": "Welcome to our podcast.",
"voice": "voice-id-here"
}Available voice IDs depend on the model. Check the model's documentation for supported voices.
prompt tips
For TTS:
- Use natural punctuation to control pacing and intonation.
- Longer texts produce longer audio — cost scales accordingly.
For music:
- Describe the genre, tempo, instruments, and mood.
- Include BPM for more precise tempo control.
- Example:
"cinematic orchestral score with strings and brass, slow build, 80 BPM"