API Reference
Audio Tool
Speech-to-text and text-to-speech capabilities
Speech-to-Text (Transcription)
Transcribe audio files to text. Compatible with the OpenAI Whisper API format.
Endpoint
POST /v1/audio/transcribeRequest (multipart/form-data)
Upload an audio file directly:
curl https://api.router9.com/v1/audio/transcribe \
-H "Authorization: Bearer sk-r9k-your-key" \
-F [email protected] \
-F language=enRequest (JSON)
Provide audio via URL or base64:
curl https://api.router9.com/v1/audio/transcribe \
-H "Authorization: Bearer sk-r9k-your-key" \
-H "Content-Type: application/json" \
-d '{
"mediaUrl": "https://example.com/audio.mp3",
"language": "en"
}'| Parameter | Type | Required | Description |
|---|---|---|---|
file | binary | One of file/mediaUrl/mediaBase64 | Audio file (multipart upload) |
mediaUrl | string | One of file/mediaUrl/mediaBase64 | URL to audio file |
mediaBase64 | string | One of file/mediaUrl/mediaBase64 | Base64-encoded audio |
language | string | No | Language hint, e.g. en, zh |
model | string | No | Override the default transcription model (must be allowlisted) |
Response
{
"success": true,
"tool": "audio_transcribe",
"result": {
"fullText": "Hello everyone, today we'll discuss the new API design."
}
}Text-to-Speech (Synthesis)
Convert text to spoken audio.
Endpoint
POST /v1/audio/synthesizeRequest
curl https://api.router9.com/v1/audio/synthesize \
-H "Authorization: Bearer sk-r9k-your-key" \
-H "Content-Type: application/json" \
-d '{
"input": "Hello, welcome to Router9!",
"voice": "nova"
}' \
--output speech.wav| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | Yes | Text to synthesize (max 4,096 characters) |
voice | string | No | Voice: alloy, echo, fable, onyx, nova, shimmer (default alloy) |
model | string | No | Override the default TTS model (must be allowlisted) |
Response
Returns WAV audio as the binary response body with Content-Type: audio/wav.
Text-to-speech requires an audio-output model configured for the
ttsskill on your deployment. If none is configured, this endpoint returns503with"no active model configured".
Credits
Audio Skill calls consume credits from your plan's monthly credit allowance — the same allowance used for chat completions. There are no separate per-Skill quotas. See Credits & Usage and Tool Usage & Credits.