Get a stock voice
curl --request GET \
--url https://api.pyai.com/v1/voices/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pyai.com/v1/voices/{id}"
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/voices/{id}', 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/voices/{id}",
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/voices/{id}"
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/voices/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/voices/{id}")
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{
"object": "voice",
"voice_id": "stock_dorit_en_us",
"name": "Imogen",
"gender": "M",
"region": "UK (England / RP)",
"age": "32",
"tone": "polished, reassuring",
"bio": "Calm, articulate London front-desk.",
"language": "en",
"avatar_url": "<string>",
"preview_url": "<string>",
"accent": "<string>",
"age_band": "<string>",
"pitch_band": "<string>",
"pace": "<string>",
"use_cases": [
"<string>"
],
"search_tags": [
"<string>"
],
"aliases": [
"<string>"
],
"available_on": [
"speak"
],
"speak_emotions": [
"neutral"
],
"synthesis_modes": [
"streaming"
],
"tier": "standard",
"pricing": {
"included_in_base_price": true,
"additional_price_usd_per_minute": 0
},
"source_dataset": "<string>",
"license": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}Text To Speech (Speak)
Get a stock voice
GET
/
v1
/
voices
/
{id}
Get a stock voice
curl --request GET \
--url https://api.pyai.com/v1/voices/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pyai.com/v1/voices/{id}"
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/voices/{id}', 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/voices/{id}",
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/voices/{id}"
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/voices/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/voices/{id}")
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{
"object": "voice",
"voice_id": "stock_dorit_en_us",
"name": "Imogen",
"gender": "M",
"region": "UK (England / RP)",
"age": "32",
"tone": "polished, reassuring",
"bio": "Calm, articulate London front-desk.",
"language": "en",
"avatar_url": "<string>",
"preview_url": "<string>",
"accent": "<string>",
"age_band": "<string>",
"pitch_band": "<string>",
"pace": "<string>",
"use_cases": [
"<string>"
],
"search_tags": [
"<string>"
],
"aliases": [
"<string>"
],
"available_on": [
"speak"
],
"speak_emotions": [
"neutral"
],
"synthesis_modes": [
"streaming"
],
"tier": "standard",
"pricing": {
"included_in_base_price": true,
"additional_price_usd_per_minute": 0
},
"source_dataset": "<string>",
"license": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}Authorizations
apiKeyxApiKey
Path Parameters
Response
Stock voice
Delivery modes accepted for this voice on POST /v1/audio/speech. Every Speak-available voice accepts both; a voice served from a blocking-only fleet answers a streaming request with x-pyai-stream: buffered. An empty list means the voice has no Speak surface at all (check available_on).
Available options:
streaming, async