SDK
import { Geko } from "@gekoai/sdk";
import { writeFile } from "node:fs/promises";
const geko = new Geko({ apiKey: process.env.GEKO_API_KEY });
const audio = await geko.tts.create({
text: "Сәлеметсіз бе! Тапсырыс нөмірі 152.",
voice: "Aigerim",
});
await writeFile("hello.wav", Buffer.from(audio));import os, requests
res = requests.post(
"https://geko--tokay-serve-web.modal.run/v1/tts",
headers={"Authorization": f"Bearer {os.environ['GEKO_API_KEY']}"},
json={"text": "Сәлеметсіз бе! Тапсырыс нөмірі 152.", "voice": "Aigerim"},
)
res.raise_for_status()
with open("hello.wav", "wb") as f:
f.write(res.content)curl --request POST \
--url https://geko--tokay-serve-web.modal.run/v1/tts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸.",
"model": "tokay-kk-v1",
"voice": "Aigerim",
"speed": 1,
"nfe": 32,
"normalize": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸.',
model: 'tokay-kk-v1',
voice: 'Aigerim',
speed: 1,
nfe: 32,
normalize: true
})
};
fetch('https://geko--tokay-serve-web.modal.run/v1/tts', 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://geko--tokay-serve-web.modal.run/v1/tts",
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([
'text' => 'Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸.',
'model' => 'tokay-kk-v1',
'voice' => 'Aigerim',
'speed' => 1,
'nfe' => 32,
'normalize' => true
]),
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://geko--tokay-serve-web.modal.run/v1/tts"
payload := strings.NewReader("{\n \"text\": \"Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸.\",\n \"model\": \"tokay-kk-v1\",\n \"voice\": \"Aigerim\",\n \"speed\": 1,\n \"nfe\": 32,\n \"normalize\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://geko--tokay-serve-web.modal.run/v1/tts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸.\",\n \"model\": \"tokay-kk-v1\",\n \"voice\": \"Aigerim\",\n \"speed\": 1,\n \"nfe\": 32,\n \"normalize\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geko--tokay-serve-web.modal.run/v1/tts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸.\",\n \"model\": \"tokay-kk-v1\",\n \"voice\": \"Aigerim\",\n \"speed\": 1,\n \"nfe\": 32,\n \"normalize\": true\n}"
response = http.request(request)
puts response.read_body"<string>"{
"detail": "text is required"
}{
"detail": "invalid API key"
}{
"detail": "unknown voice"
}{
"detail": "out of credits — top up in the geko console"
}{
"detail": "service temporarily unavailable"
}API reference
Synthesize speech
Synthesize text into speech. Returns raw WAV bytes (audio/wav, 24 kHz, 16-bit PCM, mono). The X-Tokay-Chars response header reports the billed character count.
POST
/
v1
/
tts
SDK
import { Geko } from "@gekoai/sdk";
import { writeFile } from "node:fs/promises";
const geko = new Geko({ apiKey: process.env.GEKO_API_KEY });
const audio = await geko.tts.create({
text: "Сәлеметсіз бе! Тапсырыс нөмірі 152.",
voice: "Aigerim",
});
await writeFile("hello.wav", Buffer.from(audio));import os, requests
res = requests.post(
"https://geko--tokay-serve-web.modal.run/v1/tts",
headers={"Authorization": f"Bearer {os.environ['GEKO_API_KEY']}"},
json={"text": "Сәлеметсіз бе! Тапсырыс нөмірі 152.", "voice": "Aigerim"},
)
res.raise_for_status()
with open("hello.wav", "wb") as f:
f.write(res.content)curl --request POST \
--url https://geko--tokay-serve-web.modal.run/v1/tts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸.",
"model": "tokay-kk-v1",
"voice": "Aigerim",
"speed": 1,
"nfe": 32,
"normalize": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸.',
model: 'tokay-kk-v1',
voice: 'Aigerim',
speed: 1,
nfe: 32,
normalize: true
})
};
fetch('https://geko--tokay-serve-web.modal.run/v1/tts', 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://geko--tokay-serve-web.modal.run/v1/tts",
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([
'text' => 'Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸.',
'model' => 'tokay-kk-v1',
'voice' => 'Aigerim',
'speed' => 1,
'nfe' => 32,
'normalize' => true
]),
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://geko--tokay-serve-web.modal.run/v1/tts"
payload := strings.NewReader("{\n \"text\": \"Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸.\",\n \"model\": \"tokay-kk-v1\",\n \"voice\": \"Aigerim\",\n \"speed\": 1,\n \"nfe\": 32,\n \"normalize\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://geko--tokay-serve-web.modal.run/v1/tts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸.\",\n \"model\": \"tokay-kk-v1\",\n \"voice\": \"Aigerim\",\n \"speed\": 1,\n \"nfe\": 32,\n \"normalize\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://geko--tokay-serve-web.modal.run/v1/tts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸.\",\n \"model\": \"tokay-kk-v1\",\n \"voice\": \"Aigerim\",\n \"speed\": 1,\n \"nfe\": 32,\n \"normalize\": true\n}"
response = http.request(request)
puts response.read_body"<string>"{
"detail": "text is required"
}{
"detail": "invalid API key"
}{
"detail": "unknown voice"
}{
"detail": "out of credits — top up in the geko console"
}{
"detail": "service temporarily unavailable"
}Authorizations
Body
application/json
Text to synthesize (up to ~5000 characters).
Example:
"Сәлеметсіз бе! Тапсырыс нөмірі 152, сомасы 5500 ₸."
Model id.
Voice name from GET /v1/voices. Defaults to the model's default voice.
Speed multiplier.
Required range:
0.5 <= x <= 2Diffusion steps: 16 fast, 32 quality.
Expand numbers, currency, and dates into spoken Kazakh.
Response
WAV audio.
The response is of type file.
⌘I