Skip to main content
Base URL: https://api.lokutor.com. Every route also answers under a /v1/ prefix (/v1/tts/synthesize is the same endpoint as /tts/synthesize). Authenticated endpoints accept Authorization: Bearer <key>, X-API-Key: <key> or ?api_key=<key>, with an API key or a wst_ ticket (Authentication). Streaming synthesis and live transcription run over WebSocket: see Real-time Streaming and Speech-to-Text. Phone numbers and calls are in the Call Center API. Errors use the structured shape in the Error Catalog, except where noted below.

POST /tts/synthesize — TTS Synthesis

Synthesizes text and returns the whole clip as a WAV file. Billed per character from your balance (rate card: tts_per_million_chars).

Request

Each entry in segments is either speech, { "text", "voice"?, "language"? } (falling back to the top-level voice and language), or a pause, { "pause_ms": 500 }. Every segment’s voice and language are validated before any audio is produced, so a bad value in the last segment fails the request without synthesizing the others.
The older names voice_id, lang and quality are accepted as aliases. quality is ignored. New code should use voice and language.

Limits

Characters are counted as characters, not bytes: an accented letter is one.

Response

200, Content-Type: audio/wav: 16-bit PCM, 44.1 kHz, mono. The 503 body is not the error-catalog shape:

cURL


POST /stt/transcribe — Speech-to-Text

Transcribes one complete audio clip. For live transcription from a microphone, use WS /ws/stt (Speech-to-Text). Recognition covers English, Spanish, Catalan, Galician, Basque, Portuguese, French, Italian and German, with one model for all nine. The text comes back written out: digits, phone numbers, e-mail addresses, punctuation and casing. Billed per minute of audio (rate card: stt_per_minute).

Request

Send either multipart/form-data with the file in a field named audio (plus optional language and keyterms), or JSON with base64 audio:
Accepted audio: WAV with 8- or 16-bit PCM, mono or stereo, at 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100 or 48000 Hz, up to 10 MB. Anything else answers 400 validation.invalid_request_format. This API’s own TTS output (44.1 kHz WAV) is accepted as is.

Response

cURL


POST /denoise — Audio Denoising

Removes background noise from a WAV file with Psst, the same model that cleans callers’ audio on agent calls. Billed per minute of audio (rate card: denoise_per_minute).

Request

multipart/form-data with the WAV file in a field named audio. The same formats and the same 10 MB limit as /stt/transcribe apply; anything else answers 400 validation.invalid_request_format. If the denoiser is unavailable or fails, the answer is 503 agent.provider_error.

Response

200, Content-Type: audio/wav: the denoised audio, 16-bit PCM.

POST /ws-ticket — Short-lived Ticket

Exchanges your API key, sent in the Authorization or X-API-Key header (never the URL), for a ticket that works anywhere a key does for 10 minutes. Use it to keep the key out of browsers. See Authentication and Secure browser setup.

Discovery

These endpoints need no key.

GET /voices — List Voice Styles

GET /voices lists the built-in slots only. Your cloned voices are listed in the dashboard under Voices, each with its clone_… id; any endpoint that takes a voice accepts one only from an API key on the account that created it, and answers validation.invalid_voice from any other account.

GET /languages — List Supported Languages

Every language text-to-speech can speak. Speech recognition covers all nine.

GET /models — List TTS Models

versa-2.0 is the only model served.

GET /config — Server Configuration

GET /status — Runtime Status

status is "ok" or "warming_up", and ready says whether the server can serve. The other fields describe the one API server that answered and are informational; inference is an internal label and does not say where synthesis runs.

GET /v1/pricing — Rate Card

Every price Lokutor charges, as JSON. Fields and an example are on the Rate Card page; how the prices apply is in Pricing and billing.

GET /ready — Readiness

200 {"ready": true, "status": "ready"} once the server can serve requests; 503 {"ready": false, "status": "not_ready"} while it is starting. Use it for uptime checks.

JavaScript SDK

The SDK wraps the discovery endpoints as static methods on VoiceAgentClient. They call https://api.lokutor.com and throw LokutorError on failure.

cURL Examples