Browse documentation

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/transcriptions

Requests 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:

ParameterTypeRequiredDefaultDescription
filebinaryYes—Audio file (flac, mp3, mp4, wav, webm, etc.; max 25 MB).
modelstringYes—Model ID (e.g. whisper-1).
languagestringNo—ISO-639-1 language code (e.g. en, es, fr).
promptstringNo—Optional steering text for domain terms or style.
response_formatstringNojsonFormat: json, text, srt, verbose_json, or vtt.
temperaturenumberNo0Sampling 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 StatusError CodeReason
400 Bad Requestinvalid_requestMissing file or model, unsupported codec, or corrupt audio.
400 Bad Requestguardrail_blockedPrompt guidance text violated safety or injection policies.
401 Unauthorizedinvalid_api_keyVirtual key missing, expired, or invalid.
402 Payment Requiredinsufficient_creditsOrganization balance insufficient for duration hold.
413 Payload Too Largepayload_too_largeFile exceeds 25 MB limit.
429 Too Many Requestsrate_limit_exceededAccount or key RPM ceiling exceeded; check x-nr-limit-source.
POST
/v1/audio/transcriptions

Authorization

NRouterApiKey
AuthorizationBearer <token>

Your nRouter virtual key (sk-nrouter-…). Sent as Authorization: Bearer sk-nrouter-….

In: header

Header Parameters

x-nr-tags?string

Custom spend and attribution tags (comma-separated key=value pairs)

x-nr-mcp-server?string

Target MCP server ID when routing MCP tool calls or prompts through the gateway

x-nr-client-language?string

Caller SDK runtime language identification (e.g. typescript, python, rust, go)

x-nr-session-id?string

Caller session identifier allowed at edge for grouping related client turns

x-nr-trace?string

Inbound trace detail level override for request lifecycle spans

Value in

  • "off"
  • "stages"
  • "verbose"
x-nr-trace-stages?string

Inbound stage-level trace emission override

Value in

  • "off"
  • "stages"
  • "verbose"
x-nr-trace-id?string

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."}
Was this page helpful?