Transcription
POST
https://api.oneinfer.ai/v1/ula/transcribeTranscribe 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
AuthorizationstringrequiredBearer token for authentication. Format:
Bearer <YOUR_TOKEN>. Exchange your API key for a token via the Authentication endpoint.Content-TypestringrequiredFor 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.
filefileExactly one audio file, sent as multipart/form-data. Required unless source_url is supplied; do not send both.
transcription_request_jsonstringWith an upload: the fields below as one JSON string.
modelstringrequiredThe 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.languagestringThe language spoken, as a code the model knows (e.g. en; Sarvam models take codes like hi-IN). Auto-detected if omitted.
promptstringOptional. Spellings to expect, such as names and product terms (e.g. OneInfer, DeepInfra).
response_formatstringOptional.
"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_urlstringA public audio URL to transcribe instead of an upload. Only some models take one, such as ElevenLabs Scribe; the others need an upload.
streambooleanMust 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
| Code | Status | Description |
|---|---|---|
200 | OK | Audio transcribed successfully. |
422 | Validation Error | Requires an STT model, exactly one audio input, and stream=false. |
401 | Unauthorized | Missing or invalid Authorization header / Bearer token. |
403 | Forbidden | Insufficient credit balance. |
415 | Unsupported Media Type | Audio format not supported by the selected model. |
500 | Internal Server Error | Unexpected error during transcription. |