Skip to content
SPEECH
community

Text to speech with Kokoro

Hosted Kokoro-82M inference for fast, low-cost text-to-speech. Kokoro is a compact 82-million-parameter TTS model that produces natural-sounding speech from plain text. Socaity runs it on hosted GPUs, so you get sub-second synthesis from any machine without managing your own hardware. Pick a built-in voice, set the speaking speed, pass your text, and save the audio.

by jaaari · socaity.sdk.replicate.jaaari.kokoro_82m

Capabilities

Kokoro does one job and does it well: it turns text into speech. The predictions endpoint takes the text you want spoken, an optional speed to control pacing, and a selectable voice id. It returns a single audio file you can save directly to disk.

Install

Install the Socaity SDK, then install the Kokoro service once so the client is available locally:

bash
pip install socaity
socaity install jaaari/kokoro-82m

Authentication

Kokoro is a Socaity-hosted service. Set SOCAITY_API_KEY in your environment. You can generate a key at socaity.ai under Account, Secrets.

bash
export SOCAITY_API_KEY="sk_..."

Quick start

Synthesise one line of speech and save the result as a WAV file. .get_result() blocks until the job finishes; for a single output it returns one media_toolkit.AudioFile, so you can call .save() on it directly.

python
import os
from socaity.sdk.replicate.jaaari import kokoro_82m

tts = kokoro_82m(api_key=os.getenv("SOCAITY_API_KEY"))

audio = tts(
    text="Hello from Socaity",
    speed=1.0,
).get_result()

audio.save("speech.wav")

Constructor

kokoro_82m(api_key: str = None) returns a client bound to the Kokoro service. When api_key is omitted the SDK reads SOCAITY_API_KEY from the environment. Calling the instance (tts(...)) runs the predictions endpoint and returns a Job.

Parameters

Call the client with the following parameters. Only text is required.

ParameterTypeDefaultDescription
textstrrequiredThe text to synthesise into speech.
speedfloat1.0Speaking speed. Values above 1.0 are faster; below 1.0 are slower.
voicestrdefault voiceSelectable voice id for the generated speech.

Pricing & live playground

Current pricing and the interactive playground live on socaity.ai.

Open Kokoro on socaity.ai

Next steps