Audio — Text-to-Speech & Speech-to-Text
POST
/v1/generationsGenerate speech from text (TTS) or transcribe audio to text (STT).
Text-to-Speech
python
response = client.post("/v1/generations", json={
"model": "openai/tts-1",
"input": "Hello, welcome to SandBase!",
"voice": "alloy"
})
# Returns audio URL
print(response.json()["outputs"][0]["url"])Speech-to-Text
python
response = client.post("/v1/generations", json={
"model": "openai/whisper-1",
"audio_url": "https://example.com/audio.mp3"
})
print(response.json()["outputs"][0]["text"])Available Models
| Model | Type | Provider |
|---|---|---|
openai/tts-1 | TTS | OpenAI |
openai/tts-1-hd | TTS (HD) | OpenAI |
openai/whisper-1 | STT | OpenAI |
fish-audio/speech-1 | TTS | Fish Audio |

