Transcribe audio file
curl -X POST "https://api.upliftai.org/v1/transcribe/speech-to-text" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@/path/to/audio.mp3" \
-F "model=scribe" \
-F "language=ur"
import requests
url = "https://api.upliftai.org/v1/transcribe/speech-to-text"
files = {'file': open('audio.mp3', 'rb')}
data = {
'model': 'scribe-mini', # Use cost-effective model
'language': 'ur',
'domain': 'phone-commerce' # Optimize for e-commerce
}
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(url, files=files, data=data, headers=headers)
result = response.json()
print(f"Transcription: {result['text']}")
const form = new FormData();
form.append('file', '<string>');
form.append('model', 'scribe');
form.append('language', 'ur');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://api.upliftai.org/v1/transcribe/speech-to-text', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.upliftai.org/v1/transcribe/speech-to-text",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nscribe\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nur\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data; boundary=---011000010111000001101001"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.upliftai.org/v1/transcribe/speech-to-text"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nscribe\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nur\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.upliftai.org/v1/transcribe/speech-to-text")
.header("Authorization", "<api-key>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nscribe\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nur\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/transcribe/speech-to-text")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nscribe\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nur\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"text": "آج کا موسم کیسا ہے؟ میں نے سنا ہے کہ بارش ہونے والی ہے۔"
}
Scribe REST API
Speech to Text (Beta)
Transcribe audio files to text using AI models
Converts audio files to text using Uplift’s speech recognition models optimized for Urdu language.
Model Selection:
- scribe: Full accuracy model - 40 credits per minute
- scribe-mini: Cost-effective model - 20 credits per minute (50% cheaper)
Domain Optimization:
Use the domain parameter for improved accuracy in specialized contexts:
- phone-commerce: Optimized for e-commerce conversations
- farming: Optimized for agricultural terminology
POST
/
transcribe
/
speech-to-text
Transcribe audio file
curl -X POST "https://api.upliftai.org/v1/transcribe/speech-to-text" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@/path/to/audio.mp3" \
-F "model=scribe" \
-F "language=ur"
import requests
url = "https://api.upliftai.org/v1/transcribe/speech-to-text"
files = {'file': open('audio.mp3', 'rb')}
data = {
'model': 'scribe-mini', # Use cost-effective model
'language': 'ur',
'domain': 'phone-commerce' # Optimize for e-commerce
}
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(url, files=files, data=data, headers=headers)
result = response.json()
print(f"Transcription: {result['text']}")
const form = new FormData();
form.append('file', '<string>');
form.append('model', 'scribe');
form.append('language', 'ur');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://api.upliftai.org/v1/transcribe/speech-to-text', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.upliftai.org/v1/transcribe/speech-to-text",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nscribe\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nur\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data; boundary=---011000010111000001101001"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.upliftai.org/v1/transcribe/speech-to-text"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nscribe\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nur\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.upliftai.org/v1/transcribe/speech-to-text")
.header("Authorization", "<api-key>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nscribe\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nur\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/transcribe/speech-to-text")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nscribe\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nur\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"text": "آج کا موسم کیسا ہے؟ میں نے سنا ہے کہ بارش ہونے والی ہے۔"
}
This API is currently in beta. Features and pricing may change.
{
"text": "آج کا موسم کیسا ہے؟ میں نے سنا ہے کہ بارش ہونے والی ہے۔"
}
Authorizations
API key with format "Bearer sk_api_..."
Body
multipart/form-data
Audio file to transcribe (max 25MB)
AI model to use
Available options:
scribe, scribe-mini Language of the audio
Available options:
ur Domain-specific optimization
Available options:
phone-commerce, farming Response
Successful transcription
Response from speech-to-text transcription
Transcribed text from the audio
⌘I
