Transcription

POSThttps://api.oneinfer.ai/v1/ula/transcribe

Transcribe audio into text using the universal speech-to-text API. Name a transcription model and upload one audio file; OneInfer picks the provider that serves the model.

Request headers

Authorizationstringrequired
Bearer token for authentication. Format: Bearer <YOUR_TOKEN>. Exchange your API key for a token via the Authentication endpoint.
Content-Typestringrequired
For uploads, let your HTTP client set multipart/form-data with its boundary. For source_url requests, use application/json.

Request parameters

Send the audio as file and the other fields as one JSON string in transcription_request_json. With source_url instead of an upload, send the fields as a JSON body.

filefile
Exactly one audio file, sent as multipart/form-data. Required unless source_url is supplied; do not send both.
transcription_request_jsonstring
With an upload: the fields below as one JSON string.
modelstringrequired
The transcription model, by its name in the model catalog (e.g. "openai/whisper-large-v3-turbo", "elevenlabs/scribe-v2", "sarvam/saaras:v3"). OneInfer picks the provider that serves it; the response's provider field says which one did.
languagestring
The language spoken, as a code the model knows (e.g. en; Sarvam models take codes like hi-IN). Auto-detected if omitted.
promptstring
Optional. Spellings to expect, such as names and product terms (e.g. OneInfer, DeepInfra).
response_formatstring
Optional. "json" (the default) or "verbose_json", which adds the segments, and the words if asked for, with their times in provider_metadata.transcription.
timestamp_granularitiesstring[]
Optional. ["word"], ["segment"] or both. Needs response_format: "verbose_json". A model that can't return them answers 422 with a message.
source_urlstring
A public audio URL to transcribe instead of an upload. Only some models take one, such as ElevenLabs Scribe; the others need an upload.
streamboolean
Must be false. This endpoint returns a completed transcription.

Example request

Example STT Request (cURL)
curl -X POST https://api.oneinfer.ai/v1/ula/transcribe \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -F "file=@/path/to/audio.mp3" \
  -F 'transcription_request_json={"model": "openai/whisper-large-v3-turbo", "language": "en"}'
Example STT Request with word timings (cURL)
curl -X POST https://api.oneinfer.ai/v1/ula/transcribe \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -F "file=@/path/to/audio.mp3" \
  -F 'transcription_request_json={"model": "openai/whisper-large-v3-turbo", "language": "en", "prompt": "OneInfer, DeepInfra", "response_format": "verbose_json", "timestamp_granularities": ["word"]}'

Response

JSON
{
    "api_details": {
        "api_status": "success",
        "api_message": "API has return response successfully."
    },
    "data": {
        "id": "3ab483fe-2444-40f7-9cf2-720eeee21125",
        "created": 1776233397,
        "text": "Oh my god. The real danger is not that computers start thinking like people, but that people start thinking like computers. Computers can only help us with simple tasks.",
        "finish_reason": "stop",
        "provider": "sarvam",
        "model": "saaras:v3",
        "usage": {
            "prompt_tokens": 29,
            "completion_tokens": 0,
            "total_tokens": 29,
            "cache_input_tokens": 0
        },
        "latency_ms": 1850.13,
        "tool_calls": null,
        "images": [],
        "videos": [],
        "resolution": null,
        "audios": []
    },
    "error": {}
}

Error status codes

CodeStatusDescription
200OKAudio transcribed successfully.
422Validation ErrorRequires an STT model, exactly one audio input, and stream=false.
401UnauthorizedMissing or invalid Authorization header / Bearer token.
403ForbiddenInsufficient credit balance.
415Unsupported Media TypeAudio format not supported by the selected model.
500Internal Server ErrorUnexpected error during transcription.

Response

202 - application/json