Audio — Text-to-Speech & Speech-to-Text
For an audio model that runs asynchronously, you may either set webhook_url on one request or register an organization Model Webhook. Synchronous calls and LLM calls do not support task callbacks; if they contain this field, SandBase ignores it and schedules no callback. See Webhooks.
/v1/runGenerate speech from text (TTS) or transcribe audio to text (STT).
Text-to-Speech
response = client.post("/v1/run", json={
"model": "openai/tts-1",
"input": "Hello, welcome to SandBase!",
"voice": "alloy"
})
# Returns audio URL
print(response.json()["outputs"][0]["url"])Speech-to-Text
response = client.post("/v1/run", json={
"model": "openai/whisper-1",
"audio_url": "https://example.com/audio.mp3"
})
print(response.json()["outputs"][0]["text"])Per-task callback (async only)
Set webhook_url only when the selected audio model resolves to asynchronous execution:
response = client.post("/v1/run", json={
"model": "example/async-audio-model",
"mode": "async",
"input": "Hello, welcome to SandBase!",
"webhook_url": "https://hooks.example.com/sandbase/task?token=opaque-token"
})
generation_id = response.json()["id"]SandBase sends the completed, failed, or timeout event to that URL with X-Event-ID. Delivery is at-least-once, so deduplicate by that ID and return 2xx quickly. The URL must be public HTTPS. When webhook_url is present, it is the only callback target for this task and registered organization Model Webhooks are skipped; failures retry the same task URL without fallback. Per-task callbacks do not include X-Signature; omit webhook_url and use an organization Model Webhook when HMAC verification is required.
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 |

