curl --request GET \
--url https://api.pyai.com/v1/audio/interpretations/stream \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pyai.com/v1/audio/interpretations/stream"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pyai.com/v1/audio/interpretations/stream', 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.pyai.com/v1/audio/interpretations/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.pyai.com/v1/audio/interpretations/stream"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.pyai.com/v1/audio/interpretations/stream")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/audio/interpretations/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}Open a two-person live interpretation session
Connect over WebSocket with a live key holding interpret:session. Server clients use Bearer authentication; browsers use an origin-locked token from the session mint and offer pyai.v1, then pyai-key.<token> as subprotocols. Credentials are never accepted in the URL.
After hello, send session.start with external_call_id, sample_rate:16000, and legs.customer and legs.agent, each containing participant_id, language and voice. Choose any two different supported languages; read hello.languages for each language code and accepted/default voices, and hello.synthetic_audio_tested_pairs for the narrow completed synthetic audio checks. Equal languages are rejected before recognition opens. Audio is mono PCM16 little endian, base64 encoded in JSON audio.append with leg, current epoch, zero-based increasing sequence and audio. Each frame is at most 200ms.
Available languages: Arabic (ar), Bengali (bn), English (en), French (fr), German (de), Gujarati (gu), Hindi (hi), Italian (it), Japanese (ja), Kannada (kn), Korean (ko), Mandarin Chinese (zh), Portuguese (pt), Punjabi (pa), Russian (ru), Spanish (es), Telugu (te), Urdu (ur). Hindi/English and Punjabi/English have completed synthetic audio checks; other pairs are available to try and have not yet completed those checks. Availability does not establish human translation quality, accent coverage or ten-call capacity.
Stable translated phrases produce translation.committed, audio.chunk and audio.completed before the speaker finishes. Source transcript.committed fragments have independent character offsets; source_context_id attributes both ledgers to a stream context without implying word alignment. input.commit optionally ends the current source context; it is not required to start translated speech.
Provide separate dry participant input legs. The listener input is gated during translated playback. Report actual playback with playback.report (utterance_id, target_epoch, status, played_samples); cancellation does not prove playback stopped. When hello.playback_statuses advertises playing, report only carrier-confirmed advancing prefixes with status: playing. Prefix progress keeps the listener gate closed and never completes an utterance or resets its 45-second hard deadline. Respect input.gated and input.resumed, and physically clear playback before a required playback.cleared acknowledgement after a transfer. leg.replace preserves epoch/revision fencing. Close with session.end.
Billing is connected session time for both directions together, including silence, under interpret.minutes. Rejected upgrades are not billed. The stream itself does not persist call history. Explicitly create a call archive using POST /v1/audio/interpretations/recordings and upload the bridge transcript/audio to retrieve it through /v1/audio/interpretations/calls. It does not integrate a PBX automatically.
curl --request GET \
--url https://api.pyai.com/v1/audio/interpretations/stream \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pyai.com/v1/audio/interpretations/stream"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pyai.com/v1/audio/interpretations/stream', 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.pyai.com/v1/audio/interpretations/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.pyai.com/v1/audio/interpretations/stream"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.pyai.com/v1/audio/interpretations/stream")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/audio/interpretations/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}