Quick Start

From nothing to a generated audio file in about two minutes. Everything below is a real request against the live API.

1

Create an API key

Open the API keys page in your dashboard and create a key. Copy it once — it is shown in full only at creation. Keep it on the server side; a key in browser code is a key anyone can read.

Open API keys
2

Generate your first audio

The response body is the audio file itself, not JSON wrapping a base64 string. Write it straight to disk or hand it to an audio element.

curl https://api.kiritts.com/v1/audio/speech \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kiritts",
"input": "សួស្តី ពិភពលោក! Hello, world!",
"voice": "Maly",
"response_format": "mp3"
}' \
--output speech.mp3
3

Or use the OpenAI SDK

The API is OpenAI-compatible, so an existing integration needs a new base URL and key, nothing more.

JavaScript

import { writeFile } from 'node:fs/promises'
import OpenAI from 'openai'
const client = new OpenAI({
apiKey: process.env.KIRI_API_KEY,
baseURL: 'https://api.kiritts.com/v1',
})
const response = await client.audio.speech.create({
model: 'kiritts',
voice: 'Maly',
input: 'សួស្តី ពិភពលោក! Hello, world!',
})
const buffer = Buffer.from(await response.arrayBuffer())
await writeFile('speech.mp3', buffer)

Python

import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["KIRI_API_KEY"],
base_url="https://api.kiritts.com/v1",
)
response = client.audio.speech.create(
model="kiritts",
voice="Maly",
input="សួស្តី ពិភពលោក! Hello, world!",
)
response.stream_to_file("speech.mp3")
4

Transcribe audio too

Send a file as multipart form data and get back text with segments. Add word_timestamps to receive timings for every word.

curl https://api.kiritts.com/v1/audio/transcriptions \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@meeting.mp3" \
-F "model=kiristt" \
-F "response_format=json"

Where to next

The three pages that answer most follow-up questions.