Finish a real-time session
curl --request POST \
--url https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}/finish \
--header 'Content-Type: application/json' \
--header 'accessKey: <accesskey>' \
--data '
{
"capturedSamples": {}
}
'import requests
url = "https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}/finish"
payload = { "capturedSamples": {} }
headers = {
"accessKey": "<accesskey>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {accessKey: '<accesskey>', 'Content-Type': 'application/json'},
body: JSON.stringify({capturedSamples: {}})
};
fetch('https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}/finish', 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}/finish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'capturedSamples' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}/finish"
payload := strings.NewReader("{\n \"capturedSamples\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("accessKey", "<accesskey>")
req.Header.Add("Content-Type", "application/json")
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.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}/finish")
.header("accessKey", "<accesskey>")
.header("Content-Type", "application/json")
.body("{\n \"capturedSamples\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}/finish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accessKey"] = '<accesskey>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"capturedSamples\": {}\n}"
response = http.request(request)
puts response.read_bodySpeech to Text
Finish a real-time session
Flush the tail, settle once and complete the task.
POST
/
sound_clone
/
api
/
v1
/
stt
/
realtime
/
sessions
/
{sessionId}
/
finish
Finish a real-time session
curl --request POST \
--url https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}/finish \
--header 'Content-Type: application/json' \
--header 'accessKey: <accesskey>' \
--data '
{
"capturedSamples": {}
}
'import requests
url = "https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}/finish"
payload = { "capturedSamples": {} }
headers = {
"accessKey": "<accesskey>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {accessKey: '<accesskey>', 'Content-Type': 'application/json'},
body: JSON.stringify({capturedSamples: {}})
};
fetch('https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}/finish', 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}/finish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'capturedSamples' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}/finish"
payload := strings.NewReader("{\n \"capturedSamples\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("accessKey", "<accesskey>")
req.Header.Add("Content-Type", "application/json")
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.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}/finish")
.header("accessKey", "<accesskey>")
.header("Content-Type", "application/json")
.body("{\n \"capturedSamples\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myvocal.ai/sound_clone/api/v1/stt/realtime/sessions/{sessionId}/finish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accessKey"] = '<accesskey>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"capturedSamples\": {}\n}"
response = http.request(request)
puts response.read_bodyFinishes a session: the server stops accepting new audio, flushes the trailing segment, waits for the
final result, settles the charge once and completes the task. A repeated finish returns the same task
and never charges twice.
Path
string
required
The session to finish.
Header
string
required
API key for authentication.
Body
string | number
The client’s confirmed capture length in samples. The decimal string form is the contract form; a
JSON number is accepted for convenience. It marks a transport gap when it exceeds what the server
received and never changes the charge.
Response
The same session view as Get a real-time session, with the terminalstatus and the final usage. The task is now in the shared History.
A plain disconnect is not a successful finish. Use this endpoint (or the
session.finish event) so
the tail is committed and the task completes.