Docs/API reference/POST /api/v1/transcribe
POST
/api/v1/transcribe
Submit an audio file for transcription, optionally translated into a target language.Authentication required
Request
Send a multipart/form-data body with the audio file and any optional fields. Returns a single JSON object once the transcription is complete.
HTTP
POST https://api.varmir.com/api/v1/transcribe
Authorization: Bearer <YOUR_API_KEY>
Content-Type: multipart/form-data
# fields
[email protected]
translate_to=ukParameters
FieldTypeDescription
audiofile (multipart)Required. WAV, FLAC, MP3, OGG/Opus, M4A/AAC or WebM. Up to 100 MB and 24 hours.
translate_tostringOptional ISO-639-1 code, e.g. uk or en. Skip it to get the transcript only.
languagestringOptional ISO-639-1 code of the spoken language. Skip it to auto-detect.
punctuatebooleanKeep punctuation and casing. Set to false for bare words. Defaults to true.
Response
Returns the transcript, the translation (if you asked for one) and what this request cost. You are charged per second of audio, rounded up. The plan's monthly quota is used first, then credits. charged_from_quota_sec and charged_from_credits_sec show the split.
{
"id": "tr_8f3a2c",
"duration_sec": 12.4,
"language": "en",
"text": "Welcome to the Varmir demo. Speak naturally and the text appears on screen.",
"translation": {
"language": "uk",
"text": "Ласкаво просимо до демо Varmir. Говоріть природно, і текст з'явиться на екрані."
},
"charged_sec": 13,
"charged_from_quota_sec": 13,
"charged_from_credits_sec": 0,
"quota_remaining_sec": 59987,
"credits_remaining_sec": 58620
}language is the detected language, or the one you passed. translation is null when you didn't pass translate_to. If translation is temporarily unavailable, translation.text contains the original text.
Errors
Errors use the common format {"error": {"code", "message"}}. The ones this endpoint can return:
error.codeHTTPMeaning
invalid_request400No audio field in the form.
invalid_audio400Empty file, or not audio we can decode.
invalid_duration400Zero length or longer than 24 hours.
unsupported_parameter400You sent diarize. Speaker labels are not available yet.
invalid_api_key401Missing, mistyped or revoked key.
insufficient_credits402Quota plus credits don't cover the whole file. Nothing is charged.
audio_too_large413File larger than 100 MB.
server_busy503All slots busy. Not charged. Retry after Retry-After seconds.
service_unavailable503Billing or recognition is down. Any charge is refunded automatically.
Code examples
curl https://api.varmir.com/api/v1/transcribe \
-H "Authorization: Bearer mstk_your_key" \
-F "[email protected]" \
-F "translate_to=uk"