Get a real-time session
curl --request GET \
--url https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId} \
--header 'accessKey: <accesskey>'import requests
url = "https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}"
headers = {"accessKey": "<accesskey>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {accessKey: '<accesskey>'}};
fetch('https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}', 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.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"accessKey: <accesskey>"
],
]);
$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.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accessKey", "<accesskey>")
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.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}")
.header("accessKey", "<accesskey>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accessKey"] = '<accesskey>'
response = http.request(request)
puts response.read_body{
"code": 123,
"message": "<string>",
"data": {
"sessionId": "<string>",
"transcriptionId": "<string>",
"status": "<string>",
"epoch": 123,
"accepting": true,
"partial": "<string>",
"lines": [
{}
],
"notices": [
{}
],
"usage": {}
}
}Speech to Text
Get a real-time session
Read the live state, usage and lines of a real-time session.
GET
/
sound_clone
/
api
/
v1
/
stt
/
realtime
/
sessions
/
{sessionId}
Get a real-time session
curl --request GET \
--url https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId} \
--header 'accessKey: <accesskey>'import requests
url = "https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}"
headers = {"accessKey": "<accesskey>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {accessKey: '<accesskey>'}};
fetch('https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}', 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.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"accessKey: <accesskey>"
],
]);
$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.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accessKey", "<accesskey>")
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.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}")
.header("accessKey", "<accesskey>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accessKey"] = '<accesskey>'
response = http.request(request)
puts response.read_body{
"code": 123,
"message": "<string>",
"data": {
"sessionId": "<string>",
"transcriptionId": "<string>",
"status": "<string>",
"epoch": 123,
"accepting": true,
"partial": "<string>",
"lines": [
{}
],
"notices": [
{}
],
"usage": {}
}
}Returns one owned session. This is also the reconnect read: it reports the current
epoch, the
received/captured cursors and whether the socket is accepting audio.
Path
string
required
The
sessionId from create.Header
string
required
API key for authentication.
Response
Successful REST calls return{ code: 1, message, data }. The fields below are inside data;
JSON downloads are the documented exception and return the transcript view directly.
number
1 for success.string
Result message.
object
Hide properties
Hide properties
string
The session id.
string
The History id.
string
The session state while open, or the task status once closed (
COMPLETED, PARTIAL, FAILED).number
The current recording segment. A
usage.updated with rotate: true means start a new segment with
session.resume; the client then sends from the new epoch.boolean
Whether the server is accepting audio for this session right now.
string
The current temporary text for the open segment.
array
The committed lines:
id, text, revisedText, languageCode, languageProbability and
entities, words and characterAlignments.array
Processing notices, for example
PROCESSING_STORAGE_NOT_APPLIED. The absence of a notice does
not guarantee that a storage preference was applied.object
estimatedCharacters, billableCharacters, elapsedMs, sentSamples, receivedSamples and
capturedSamples, all decimal strings; accepting is a boolean.