Audio
Generate speech
Convert text into speech, store the result privately, and download it with the same API key.
Create speech
Speech completes in the request and returns a private MP3 file URL.
POST
/v1/speech/generationsBearer authentication required
cURL
curl https://api.byta-ai.com/v1/speech/generations \
-H "Authorization: Bearer $BYTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Byta-Audio-1.1",
"input": "Welcome to Byta AI.",
"voice": "alloy",
"language": "en",
"speed": 1
}'200 OK
{
"id": "d07144aaddd8420ab9d0ea4d8aaa352f",
"object": "speech_generation",
"status": "completed",
"modelId": "Byta-Audio-1.1",
"creditsCharged": 1,
"audio": {
"id": "cc85a3897a3545878755290b24e2d4b4",
"mimeType": "audio/mpeg",
"sizeBytes": 184320,
"url": "https://api.byta-ai.com/v1/speech/generations/d071.../files/cc85..."
}
}Parameters
inputrequiredstringText to speak, up to 4,096 characters.
modeloptionalstringAn enabled speech model from GET /v1/models.
voiceoptionalstringA supported voice identifier, up to 128 characters.
languageoptionalstringSupported language code. Defaults to en.
speedoptionalnumberPlayback speed from 0.25 through 4.0.
Download audio
GET
/v1/speech/generations/{generationId}/files/{fileId}Use the same Bearer key; add
?download=1 for attachment disposition.Audio URLs are private
Do not expose the API key in a browser. Proxy or stream the file from your server.
Pricing
| Model | Credits per 1,000 characters |
|---|---|
Byta-Audio-1.1 | 15 |
Byta-Audio-1.1-Pro | 20 |