Make Your First API Request
Once you're familiar with generating voices through the dashboard, you can start using the Audixa API to integrate text-to-speech into your own applications and workflows.
This section shows you how to make your first programmatic request using the API.
API Endpoint
To generate speech, send a POST request to the following endpoint:
POST https://api.audixa.ai/v2/tts
Required Headers
x-api-key: YOUR_API_KEY
Content-Type: application/json
Replace YOUR_API_KEY with your actual API key from the Dashboard.
Do Not Expose API Key in Frontend Code Your API key contains sensitive credentials that can be abused if exposed. Always keep it securely stored and accessed from the backend/server. Exposing it in client-side code (HTML, JavaScript) may lead to:
- Unauthorized usage
- Data theft
- Unexpected charges or bans
- Security vulnerabilities
Best Practice: Route all API requests through your backend to protect the key.
Basic Example Request Body
{
"text": "Welcome to Audixa AI, your affordable text-to-speech solution.",
"voice": "am_Ethan",
"model":"base",
"speed": 1
}
text- The content you want to convert to speech.voice- Voice ID (see Voice Library for available voices).speed- Speed of the speech. Range: 0.5 to 2
To access additional settings and learn more about the API, please refer to the API Reference.
Code Examples
- cURL
- Python
- JavaScript
curl -X POST https://api.audixa.ai/v2/tts \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Welcome to Audixa AI, your affordable text-to-speech solution.",
"voice": "am_Ethan",
"model":"base",
"speed": 1
}'
import requests
url = "https://api.audixa.ai/v2/tts"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"text": "Welcome to Audixa AI, your affordable text-to-speech solution.",
"voice": "am_Ethan",
"model":"base",
"speed": 1
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
const response = await fetch("https://api.audixa.ai/v2/tts", {
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
text: "Welcome to Audixa AI, your affordable text-to-speech solution.",
voice: "am_Ethan",
speed: 1
})
});
const result = await response.json();
console.log(result);
Check Generation Status
Once you've made a request, the API will return a response containing a generation_id (if the request was successful).
You can check the generation status in two ways:
-
From the Dashboard
Visit your Dashboard to see the latest requests and download audio once ready. -
Using the API
Use the/statusendpoint to programmatically check the status of a request using therequest_id.
For details on how to use the status endpoint, see the API Reference → Status Endpoint.