Browse documentation

Audio Translations

Translate foreign language spoken audio directly into fluent English text across Whisper models with sub-second failover and exact list-price settlement.

The /v1/audio/translations endpoint translates audio from over 90 source languages directly into English text using Whisper models. It delivers multi-provider failover, tenant budget ceilings, and zero-markup provider list pricing via a unified gateway.

POST https://api.nrouter.ai/v1/audio/translations

Requests run preflight as Chat Completions: key validation, rate limits, and container checks (25 MB limit, prompt injection scanning). Duration-based reservations settle on completion.

Request Parameters

The request body must be submitted as multipart/form-data:

ParameterTypeRequiredDefaultDescription
filebinaryYes—Audio file (flac, mp3, mp4, wav, webm, etc.; max 25 MB).
modelstringYes—Model ID (e.g. whisper-1).
promptstringNo—Optional steering text for style or terms.
response_formatstringNojsonFormat: json, text, srt, verbose_json, or vtt.
temperaturenumberNo0Sampling temperature between 0.0 and 1.0.

Response

{
  "text": "Hello, how are you today? We are testing multi-cloud voice routing."
}

Examples

curl -X POST https://api.nrouter.ai/v1/audio/translations \
  -H "Authorization: Bearer $NROUTER_API_KEY" \
  -F file="@japanese_audio.m4a" \
  -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, or corrupted container headers.
400 Bad Requestguardrail_blockedPrompt 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/translations

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/translations" \  -F model="string" \  -F file="string"
{  "text": "Hello, how are you?"}
Was this page helpful?