Set Custom Vocabulary
š Set Custom Vocabulary
Improve transcription accuracy by creating a Custom Vocabulary. Define frequently used words and phrases to increase transcription accuracy when those terms are used.
ā ļø Note: This will replace your existing custom vocabulary for the specified language. Supported languages: English (en), Spanish (es), French (fr), German (de), Italian (it), Portuguese (pt).
š” Best Practices:
- Include proper names, company names, and technical terms specific to your domain
- Use exact spelling and capitalization you expect in the output
- Avoid common words - the system already handles these well
- Maximum 1000 words/phrases allowed
- Maximum 6 words per phrase
import requests
url = "https://api.tor.app/developer/custom_vocabulary"
api_key = "your_api_key" # Replace with your actual API key
body = {
"language": "en", # Supported: en, es, fr, de, it, pt
"words": [
"Transkriptor",
"Meetingtor",
"Speaktor",
"Kelly Byrne-Donoghue",
"Xanthippe Przybylski"
]
}
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
}
response = requests.post(url, json=body, headers=headers)
if response.status_code == 200:
print("Success:", response.json())
else:
print("Failed:", response.status_code, response.text)const axios = require('axios');
const apiKey = 'your_api_key'; // Replace with your actual API key
const url = 'https://api.tor.app/developer/custom_vocabulary';
const body = {
language: 'en', // Supported: en, es, fr, de, it, pt
words: [
'Transkriptor',
'Meetingtor',
'Speaktor',
'Kelly Byrne-Donoghue',
'Xanthippe Przybylski'
]
};
const headers = {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
};
axios.post(url, body, { headers })
.then(response => {
console.log('Success:', response.data);
})
.catch(error => {
console.error('Failed:', error.response ? error.response.data : error.message);
});import okhttp3.*;
import org.json.JSONObject;
import org.json.JSONArray;
public class SetCustomVocabulary {
private static final String API_KEY = "your_api_key";
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
String url = "https://api.tor.app/developer/custom_vocabulary";
JSONArray words = new JSONArray();
words.put("Transkriptor");
words.put("Meetingtor");
words.put("Speaktor");
words.put("Kelly Byrne-Donoghue");
words.put("Xanthippe Przybylski");
JSONObject body = new JSONObject();
body.put("language", "en");
body.put("words", words);
RequestBody requestBody = RequestBody.create(
body.toString(),
MediaType.parse("application/json")
);
Request request = new Request.Builder()
.url(url)
.post(requestBody)
.addHeader("Authorization", "Bearer " + API_KEY)
.addHeader("Content-Type", "application/json")
.build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
System.out.println("Success: " + response.body().string());
} else {
System.out.println("Failed: " + response.body().string());
}
}
}
}using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public class SetCustomVocabulary
{
private static readonly string apiKey = "your_api_key";
public static async Task Main()
{
var client = new HttpClient();
var url = "https://api.tor.app/developer/custom_vocabulary";
var body = new
{
language = "en",
words = new[] {
"Transkriptor",
"Meetingtor",
"Speaktor",
"Kelly Byrne-Donoghue",
"Xanthippe Przybylski"
}
};
var jsonBody = new StringContent(
JsonSerializer.Serialize(body),
Encoding.UTF8,
"application/json"
);
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}");
var response = await client.PostAsync(url, jsonBody);
var responseContent = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
Console.WriteLine("Success: " + responseContent);
}
else
{
Console.WriteLine("Failed: " + responseContent);
}
}
}package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
const apiKey = "your_api_key"
func main() {
url := "https://api.tor.app/developer/custom_vocabulary"
body := map[string]interface{}{
"language": "en",
"words": []string{
"Transkriptor",
"Meetingtor",
"Speaktor",
"Kelly Byrne-Donoghue",
"Xanthippe Przybylski",
},
}
bodyBytes, _ := json.Marshal(body)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(bodyBytes))
req.Header.Set("Authorization", "Bearer "+apiKey)
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
responseBody, _ := ioutil.ReadAll(resp.Body)
if resp.StatusCode == 200 {
fmt.Println("Success:", string(responseBody))
} else {
fmt.Println("Failed:", string(responseBody))
}
}<?php
$apiKey = "your_api_key";
$url = "https://api.tor.app/developer/custom_vocabulary";
$body = json_encode([
"language" => "en",
"words" => [
"Transkriptor",
"Meetingtor",
"Speaktor",
"Kelly Byrne-Donoghue",
"Xanthippe Przybylski"
]
]);
$headers = [
"Authorization: Bearer $apiKey",
"Content-Type: application/json"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode == 200) {
echo "Success: " . $response . "\n";
} else {
echo "Failed: " . $response . "\n";
}
?>require 'net/http'
require 'json'
require 'uri'
api_key = "your_api_key"
url = URI("https://api.tor.app/developer/custom_vocabulary")
body = {
"language" => "en",
"words" => [
"Transkriptor",
"Meetingtor",
"Speaktor",
"Kelly Byrne-Donoghue",
"Xanthippe Przybylski"
]
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer #{api_key}"
request["Content-Type"] = "application/json"
request.body = body.to_json
response = http.request(request)
if response.code.to_i == 200
puts "Success: #{response.body}"
else
puts "Failed: #{response.body}"
endimport okhttp3.*
import org.json.JSONObject
import org.json.JSONArray
fun main() {
val apiKey = "your_api_key"
val url = "https://api.tor.app/developer/custom_vocabulary"
val client = OkHttpClient()
val words = JSONArray().apply {
put("Transkriptor")
put("Meetingtor")
put("Speaktor")
put("Kelly Byrne-Donoghue")
put("Xanthippe Przybylski")
}
val body = JSONObject().apply {
put("language", "en")
put("words", words)
}
val requestBody = RequestBody.create(
MediaType.parse("application/json"),
body.toString()
)
val request = Request.Builder()
.url(url)
.post(requestBody)
.addHeader("Authorization", "Bearer $apiKey")
.addHeader("Content-Type", "application/json")
.build()
client.newCall(request).execute().use { response ->
if (response.isSuccessful) {
println("Success: ${response.body()?.string()}")
} else {
println("Failed: ${response.body()?.string()}")
}
}
}import Foundation
let apiKey = "your_api_key"
let url = URL(string: "https://api.tor.app/developer/custom_vocabulary")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.addValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
let body: [String: Any] = [
"language": "en",
"words": [
"Transkriptor",
"Meetingtor",
"Speaktor",
"Kelly Byrne-Donoghue",
"Xanthippe Przybylski"
]
]
request.httpBody = try! JSONSerialization.data(withJSONObject: body)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let httpResponse = response as? HTTPURLResponse {
if let data = data, let responseString = String(data: data, encoding: .utf8) {
if httpResponse.statusCode == 200 {
print("Success: \(responseString)")
} else {
print("Failed: \(responseString)")
}
}
}
}
task.resume()
RunLoop.main.run()import 'dart:convert';
import 'package:http/http.dart' as http;
void main() async {
const apiKey = 'your_api_key';
final url = Uri.parse('https://api.tor.app/developer/custom_vocabulary');
final body = jsonEncode({
'language': 'en',
'words': [
'Transkriptor',
'Meetingtor',
'Speaktor',
'Kelly Byrne-Donoghue',
'Xanthippe Przybylski'
]
});
final response = await http.post(
url,
headers: {
'Authorization': 'Bearer $apiKey',
'Content-Type': 'application/json'
},
body: body,
);
if (response.statusCode == 200) {
print('Success: ${response.body}');
} else {
print('Failed: ${response.body}');
}
}Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
language | string | Yes | Language code. Supported: en, es, fr, de, it, pt |
words | array | Yes | List of words/phrases. Maximum 1000 items, 6 words per phrase |
Response
200 OK - Custom Vocabulary Saved Successfully
{
"message": "Custom vocabulary saved successfully",
"language": "en",
"word_count": 5
}
400 Bad Request - Language Not Supported
{
"message": "Language not supported. Supported languages: en, es, fr, de, it, pt"
}
400 Bad Request - Invalid Words Field
{
"message": "words field is required and must be a list"
}
400 Bad Request - Too Many Words
{
"message": "Maximum 1000 words allowed"
}
401 Unauthorized
{
"message": "Unauthorized"
}
500 Internal Server Error
{
"message": "Error saving custom vocabulary"
}
Updated 1 day ago
