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/transcriptionsRequest (multipart/form-data)
Upload an audio file directly:
curl https://api.router9.com/v1/audio/transcriptions \
-H "Authorization: Bearer sk-r9k-your-key" \
-F [email protected] \
-F prompt="Technical meeting about API design"Request (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",
"prompt": "Technical meeting"
}'| 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 |
prompt | string | No | Context hint for transcription |
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",
"response_format": "mp3"
}' \
--output speech.mp3| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | Yes | Text to synthesize (max 4,096 characters) |
voice | string | No | Voice selection (provider-specific) |
response_format | string | No | Output format: mp3, wav, etc. |
Response
Returns the audio file binary with the appropriate Content-Type header (e.g., audio/mp3).
Quotas
| Plan | ASR (Speech-to-Text) | TTS (Text-to-Speech) |
|---|---|---|
| Free | 10/period | 10/period |
| Assistant | 200/period | 200/period |
| Engineer | 5,000/period | 5,000/period |