Router9
Documentation
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/transcribe

Request (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=en

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",
    "language": "en"
  }'
ParameterTypeRequiredDescription
filebinaryOne of file/mediaUrl/mediaBase64Audio file (multipart upload)
mediaUrlstringOne of file/mediaUrl/mediaBase64URL to audio file
mediaBase64stringOne of file/mediaUrl/mediaBase64Base64-encoded audio
languagestringNoLanguage hint, e.g. en, zh
modelstringNoOverride 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/synthesize

Request

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
ParameterTypeRequiredDescription
inputstringYesText to synthesize (max 4,096 characters)
voicestringNoVoice: alloy, echo, fable, onyx, nova, shimmer (default alloy)
modelstringNoOverride 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 tts skill on your deployment. If none is configured, this endpoint returns 503 with "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.

On this page