Choose an exact audio route
Open Models and copy a route marked Text to speech or Speech to text. The route type must match the endpoint. NI rejects an audio request sent to a chat, image, or opposite-direction audio route instead of guessing.
Generate speech
Set TTS_ROUTE to the exact text-to-speech route shown in the model catalog. Voice names and response formats are provider-specific.
export TTS_ROUTE='paste the exact text-to-speech route from /models'
curl -sS https://northerninference.ca/v1/audio/speech -H "Authorization: Bearer $NI_API_KEY" -H "Content-Type: application/json" -d '{"model":"'"$TTS_ROUTE"'","input":"Northern Inference audio check.","voice":"Kore","response_format":"wav"}' --output speech.wav
A successful response is binary audio. NI preserves the provider content type and request ID headers; it does not wrap the audio in JSON.
Transcribe audio
Set STT_ROUTE to an exact speech-to-text route. The uploaded file remains multipart binary data while NI replaces only the route field used for provider dispatch.
export STT_ROUTE='paste the exact speech-to-text route from /models'
curl -sS https://northerninference.ca/v1/audio/transcriptions -H "Authorization: Bearer $NI_API_KEY" -F "model=$STT_ROUTE" -F "file=@sample.wav" -F "response_format=json"
Billing and request records
- Text-to-speech routes settle from provider-reported audio usage when the provider exposes it.
- Per-second transcription routes meter the decoded audio duration before provider dispatch. A file whose duration cannot be measured is rejected rather than billed from a guess.
- Portal usage and custody records include the exact route, provider, jurisdiction, credential source, cost, and NI request ID. Billing telemetry also records the non-content component units used to calculate that cost.
- NI does not log uploaded audio, generated audio, or transcript content by default. Only request metadata needed for routing, billing, custody, and operations is retained.
PII substitution
Optional text PII substitution is not available for audio endpoints. An audio request with PII substitution enabled fails closed before provider dispatch, because applying a text transform to binary audio would not protect the content.
Errors stay distinct
Malformed multipart data, a missing model field, an unknown route, a route-type mismatch, duration-decoder failure, timeout, provider rejection, and an actual empty provider response are recorded and returned as different failure states. NI does not convert any of them into empty audio, an empty transcript, or a zero-duration success.