Audio
GetRouter exposes three OpenAI-compatible audio operations:
Use a model that supports the requested audio operation.
Transcribe audio
Upload the source file as multipart form data:
The JSON response contains the transcript in text.
Optional transcription fields in the API schema include:
language— ISO-639-1 language codeprompt— context or vocabulary hintresponse_format—json,text,srt,verbose_json, orvtttemperaturetimestamp_granularities—wordorsegment
Support for optional fields depends on the selected model.
Translate audio
The response uses the same basic text shape as transcription.
Generate speech
The speech request schema includes:
Python transcription example
Audio uploads and generated files can be large. Set client timeouts appropriately and stream file data instead of loading unnecessary copies into memory.
Billing and retries
Audio billing can depend on the model, input size, duration, or generated output. Check Pricing. Before retrying, determine whether the server completed the request and only the file download failed.
