Skip to content
On this page

Inference

Audio

Speech synthesis, transcription, and translation with the same auth and billing gates.

Speech

POST/v1/audio/speechAPI key
curl -X POST https://api.relayrouter.org/v1/audio/speech \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H 'content-type: application/json' \
-d '{
"model": "tts-model",
"input": "Welcome to RelayRouter.",
"voice": "alloy"
}' \
--output speech.mp3

Returns audio bytes, not JSON. Billing uses input text tokens plus the network fee.

Transcription and translation

EndpointBodyResponse
POST /v1/audio/transcriptionsmultipartfile, model, optional language.
POST /v1/audio/translationsmultipartSame shape; output is translated to English.
POST /v1/transcriptsmultipartAlias of transcriptions.
curl -X POST https://api.relayrouter.org/v1/audio/transcriptions \
-H "Authorization: Bearer $RELAY_API_KEY" \
-F model=whisper-model \
-F language=en

Returns { "text": "..." } for transcription endpoints.

Billing

Audio transcription pricing is estimated from upload bytes at roughly 2 MB per minute, with a minimum of one minute. If a model has no audio pricing configured, the call falls back to token billing on estimated audio tokens. The exact amount is recorded in usage_logs.cost_micro.

10 MB limit

Audio uploads are bounded by the global request body limit. For longer recordings, split the file into chunks before uploading.