Audio Transcriptions
Transcribe spoken audio into accurate text across Whisper models with automatic language detection, timestamping, and transparent duration-based billing.
The /v1/audio/transcriptions endpoint provides automatic speech recognition (ASR/STT) across Whisper models via nRouter's unified gateway. It accepts multipart uploads, provides automatic failover, and bills strictly per second at raw provider list prices with zero markup.
POST https://api.nrouter.ai/v1/audio/transcriptionsRequests run preflight as Chat Completions: key validation, rate limits, and payload checks (25 MB limit, prompt injection scanning). Duration-based reservations settle on completion.
Request Parameters
Requests must be sent as multipart/form-data:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file | binary | Yes | — | Audio file (flac, mp3, mp4, wav, webm, etc.; max 25 MB). |
model | string | Yes | — | Model ID (e.g. whisper-1). |
language | string | No | — | ISO-639-1 language code (e.g. en, es, fr). |
prompt | string | No | — | Optional steering text for domain terms or style. |
response_format | string | No | json | Format: json, text, srt, verbose_json, or vtt. |
temperature | number | No | 0 | Sampling temperature between 0.0 and 1.0. |
Response
{
"text": "Welcome to nRouter, the multi-cloud enterprise AI routing gateway."
}Examples
curl -X POST https://api.nrouter.ai/v1/audio/transcriptions \
-H "Authorization: Bearer $NROUTER_API_KEY" \
-F file="@meeting.mp3" \
-F model="whisper-1"Headers & Errors
Required request header: Authorization: Bearer sk-nrouter-... with Content-Type: multipart/form-data. Response telemetry includes x-nr-request-id, x-nr-latency-ms, x-nr-request-cost, x-nr-model. See Chat Completions.
| HTTP Status | Error Code | Reason |
|---|---|---|
| 400 Bad Request | invalid_request | Missing file or model, unsupported codec, or corrupt audio. |
| 400 Bad Request | guardrail_blocked | Prompt guidance text violated safety or injection policies. |
| 401 Unauthorized | invalid_api_key | Virtual key missing, expired, or invalid. |
| 402 Payment Required | insufficient_credits | Organization balance insufficient for duration hold. |
| 413 Payload Too Large | payload_too_large | File exceeds 25 MB limit. |
| 429 Too Many Requests | rate_limit_exceeded | Account or key RPM ceiling exceeded; check x-nr-limit-source. |
Authorization
NRouterApiKey Your nRouter virtual key (sk-nrouter-…). Sent as Authorization: Bearer sk-nrouter-….
In: header
Header Parameters
Target MCP server ID when routing MCP tool calls or prompts through the gateway
Caller SDK runtime language identification (e.g. typescript, python, rust, go)
Caller session identifier allowed at edge for grouping related client turns
Inbound trace detail level override for request lifecycle spans
Value in
- "off"
- "stages"
- "verbose"
Inbound stage-level trace emission override
Value in
- "off"
- "stages"
- "verbose"
Accepted so a client sending it is not refused; the value is not recorded and not propagated. Every response carries the gateway's own trace ID in this header, never the one sent.
Request Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/audio/transcriptions" \ -F model="string" \ -F file="string"{ "text": "The transcribed speech."}