curl -X GET "https://api.audixa.ai/v3/tts?generation_id=gen_abc123" \
-H "x-api-key: YOUR_API_KEY"
import requests
response = requests.get(
"https://api.audixa.ai/v3/tts",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"generation_id": "gen_abc123"},
timeout=30,
)
response.raise_for_status()
generation = response.json()
print(generation["status"])
if generation["status"] == "COMPLETED":
print(generation["audio_url"])
const query = new URLSearchParams({ generation_id: 'gen_abc123' });
const response = await fetch(`https://api.audixa.ai/v3/tts?${query}`, {
method: 'GET',
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
if (!response.ok) throw new Error(await response.text());
const generation = await response.json();
console.log(generation.status);
if (generation.status === 'COMPLETED') {
console.log(generation.audio_url);
}
{
"generation_id": "gen_abc123",
"status": "COMPLETED",
"input_text": "Hello from Audixa. This completed request passed validation.",
"voice_id": "am_ethan",
"voice_name": "Ethan",
"model": "base",
"tokens": 12,
"dollar_cost": 0.000012,
"method": "API_WALLET",
"audio_url": "https://cdn.audixa.ai/audio/gen_abc123.mp3",
"created_at": "2024-03-20T10:00:00Z",
"started_at": "2024-03-20T10:00:01Z",
"completed_at": "2024-03-20T10:00:02Z"
}
Endpoints
Get Generation
Retrieve the status and details of a TTS generation
GET
/
v3
/
tts
curl -X GET "https://api.audixa.ai/v3/tts?generation_id=gen_abc123" \
-H "x-api-key: YOUR_API_KEY"
import requests
response = requests.get(
"https://api.audixa.ai/v3/tts",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"generation_id": "gen_abc123"},
timeout=30,
)
response.raise_for_status()
generation = response.json()
print(generation["status"])
if generation["status"] == "COMPLETED":
print(generation["audio_url"])
const query = new URLSearchParams({ generation_id: 'gen_abc123' });
const response = await fetch(`https://api.audixa.ai/v3/tts?${query}`, {
method: 'GET',
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
if (!response.ok) throw new Error(await response.text());
const generation = await response.json();
console.log(generation.status);
if (generation.status === 'COMPLETED') {
console.log(generation.audio_url);
}
{
"generation_id": "gen_abc123",
"status": "COMPLETED",
"input_text": "Hello from Audixa. This completed request passed validation.",
"voice_id": "am_ethan",
"voice_name": "Ethan",
"model": "base",
"tokens": 12,
"dollar_cost": 0.000012,
"method": "API_WALLET",
"audio_url": "https://cdn.audixa.ai/audio/gen_abc123.mp3",
"created_at": "2024-03-20T10:00:00Z",
"started_at": "2024-03-20T10:00:01Z",
"completed_at": "2024-03-20T10:00:02Z"
}
Poll this endpoint to check if your generation is complete. When
status is COMPLETED, the audio_url field will contain the download link.
Endpoint
GET https://api.audixa.ai/v3/tts
Request
The generation ID returned from POST /tts.
Response
curl -X GET "https://api.audixa.ai/v3/tts?generation_id=gen_abc123" \
-H "x-api-key: YOUR_API_KEY"
import requests
response = requests.get(
"https://api.audixa.ai/v3/tts",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"generation_id": "gen_abc123"},
timeout=30,
)
response.raise_for_status()
generation = response.json()
print(generation["status"])
if generation["status"] == "COMPLETED":
print(generation["audio_url"])
const query = new URLSearchParams({ generation_id: 'gen_abc123' });
const response = await fetch(`https://api.audixa.ai/v3/tts?${query}`, {
method: 'GET',
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
if (!response.ok) throw new Error(await response.text());
const generation = await response.json();
console.log(generation.status);
if (generation.status === 'COMPLETED') {
console.log(generation.audio_url);
}
{
"generation_id": "gen_abc123",
"status": "COMPLETED",
"input_text": "Hello from Audixa. This completed request passed validation.",
"voice_id": "am_ethan",
"voice_name": "Ethan",
"model": "base",
"tokens": 12,
"dollar_cost": 0.000012,
"method": "API_WALLET",
"audio_url": "https://cdn.audixa.ai/audio/gen_abc123.mp3",
"created_at": "2024-03-20T10:00:00Z",
"started_at": "2024-03-20T10:00:01Z",
"completed_at": "2024-03-20T10:00:02Z"
}
Polling Best Practices
Poll Interval
Use a short delay with backoff, and honor
429 plus any Retry-After header.Timeout
Set a maximum polling duration appropriate for your application.
Error Handling
Always handle the
FAILED status gracefully with retry logic.Cache Results
Once completed, cache the
audio_url to avoid re-polling.Error Responses
401 Unauthorized
401 Unauthorized
Missing or invalid API key.
{
"detail": "Invalid or missing API key"
}
404 Not Found
404 Not Found
Unknown generation ID, or a generation owned by another account.
{
"detail": "Generation not found"
}
429 Too Many Requests
429 Too Many Requests
Rate limit exceeded.
{
"detail": "Rate limit exceeded. Please retry after 30 seconds."
}