Set stored Hear vocabulary
curl --request PUT \
--url https://api.pyai.com/v1/hear/vocabulary \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"terms": [
"<string>"
],
"enabled_for": []
}
'import requests
url = "https://api.pyai.com/v1/hear/vocabulary"
payload = {
"terms": ["<string>"],
"enabled_for": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({terms: ['<string>'], enabled_for: []})
};
fetch('https://api.pyai.com/v1/hear/vocabulary', 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/hear/vocabulary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'terms' => [
'<string>'
],
'enabled_for' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.pyai.com/v1/hear/vocabulary"
payload := strings.NewReader("{\n \"terms\": [\n \"<string>\"\n ],\n \"enabled_for\": []\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.pyai.com/v1/hear/vocabulary")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"terms\": [\n \"<string>\"\n ],\n \"enabled_for\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/hear/vocabulary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"terms\": [\n \"<string>\"\n ],\n \"enabled_for\": []\n}"
response = http.request(request)
puts response.read_body{
"object": "hear.vocabulary",
"terms": [
"<string>"
],
"enabled_for": [
"batch"
],
"updated_at": 123
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}Speech To Text (Hear)
Set stored Hear vocabulary
Replace the organization’s stored custom vocabulary and activation profiles. PyAI keeps at most five sanitized terms. Stored terms bias known vocabulary only for the profiles named in enabled_for. Per-job or per-session vocabulary comes first, then stored suggestions fill remaining slots up to five. Requires the hear:configure scope.
PUT
/
v1
/
hear
/
vocabulary
Set stored Hear vocabulary
curl --request PUT \
--url https://api.pyai.com/v1/hear/vocabulary \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"terms": [
"<string>"
],
"enabled_for": []
}
'import requests
url = "https://api.pyai.com/v1/hear/vocabulary"
payload = {
"terms": ["<string>"],
"enabled_for": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({terms: ['<string>'], enabled_for: []})
};
fetch('https://api.pyai.com/v1/hear/vocabulary', 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/hear/vocabulary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'terms' => [
'<string>'
],
'enabled_for' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.pyai.com/v1/hear/vocabulary"
payload := strings.NewReader("{\n \"terms\": [\n \"<string>\"\n ],\n \"enabled_for\": []\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.pyai.com/v1/hear/vocabulary")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"terms\": [\n \"<string>\"\n ],\n \"enabled_for\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/v1/hear/vocabulary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"terms\": [\n \"<string>\"\n ],\n \"enabled_for\": []\n}"
response = http.request(request)
puts response.read_body{
"object": "hear.vocabulary",
"terms": [
"<string>"
],
"enabled_for": [
"batch"
],
"updated_at": 123
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "invalid_request_error",
"param": "<string>"
}
}Authorizations
apiKeyxApiKey
Body
application/json
Response
Updated Hear vocabulary settings