Direct retrieval
curl -X GET "https://api.upliftai.org/v1/synthesis/stream-audio/media_abc123xyz?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-o output.mp3<!-- Direct embedding in HTML -->
<audio controls>
<source src="https://api.upliftai.org/v1/synthesis/stream-audio/media_abc123xyz?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." type="audio/mp3">
</audio>
import requests
url = "https://api.upliftai.org/v1/synthesis/stream-audio/{mediaId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.upliftai.org/v1/synthesis/stream-audio/{mediaId}', 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/synthesis/stream-audio/{mediaId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.upliftai.org/v1/synthesis/stream-audio/{mediaId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.upliftai.org/v1/synthesis/stream-audio/{mediaId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/synthesis/stream-audio/{mediaId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"<string>"{
"message": "Invalid or expired token"
}{
"message": "Media not found or expired"
}Orator REST API
Retrieve Async Audio
Retrieve audio generated by async text-to-speech endpoints
This endpoint retrieves audio files generated by both async TTS endpoints. Requires the mediaId and JWT token returned from the async synthesis request.
Behavior depends on the originating endpoint:
From /text-to-speech-async:
- Returns complete audio file when ready
- Typically available within 1-2 seconds
- Best for bots and webhooks needing complete files
From /text-to-speech/stream-async:
- Supports chunked streaming with ~300ms first chunk latency
- Audio streams progressively as it’s generated
- Best for frontend apps and real-time playback
Key features:
- Direct access - Can be accessed directly by clients without your API key
- Secure - JWT token ensures only authorized access to the audio
- CDN-ready - Optimized for content delivery networks
GET
/
synthesis
/
stream-audio
/
{mediaId}
Direct retrieval
curl -X GET "https://api.upliftai.org/v1/synthesis/stream-audio/media_abc123xyz?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-o output.mp3<!-- Direct embedding in HTML -->
<audio controls>
<source src="https://api.upliftai.org/v1/synthesis/stream-audio/media_abc123xyz?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." type="audio/mp3">
</audio>
import requests
url = "https://api.upliftai.org/v1/synthesis/stream-audio/{mediaId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.upliftai.org/v1/synthesis/stream-audio/{mediaId}', 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/synthesis/stream-audio/{mediaId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.upliftai.org/v1/synthesis/stream-audio/{mediaId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.upliftai.org/v1/synthesis/stream-audio/{mediaId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/synthesis/stream-audio/{mediaId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"<string>"{
"message": "Invalid or expired token"
}{
"message": "Media not found or expired"
}