Speech quickstart
Discover a model and generate your first audio response.
Before you begin
Create a Featherless API key and make it available as FEATHERLESS_API_KEY. Speech requests require a valid key, an active organization, access to the selected model, and sufficient credits.
1. List active speech models
Every example on this page reads your key from the FEATHERLESS_API_KEY environment variable, so export it once before running any of them. The Python examples need pip install requests. The TypeScript examples use top-level await, so save each one with an .mjs extension (or set "type": "module" in package.json) and run it on Node 18 or newer, which supplies the built-in fetch they rely on. The model-listing example also sends an explicit User-Agent identifying the client, because requests carrying Node's default fetch user agent are rejected.
curl --fail-with-body --get https://api.featherless.ai/v1/models \
--data-urlencode "model_class=tts" \
--data-urlencode "status=active" \
--data-urlencode "per_page=100"Use the exact case-sensitive id returned by the catalog as the speech request model.
2. Discover voices and formats
curl --fail-with-body --get https://api.featherless.ai/v1/audio/voices \
--header "Authorization: Bearer $FEATHERLESS_API_KEY" \
--data-urlencode "model=hexgrad/Kokoro-82M"This endpoint returns the public voice names, the default voice, and accepted output-format requests. It currently requires authentication even though model listing is public.
3. Generate audio
curl --fail-with-body https://api.featherless.ai/v1/audio/speech \
--header "Authorization: Bearer $FEATHERLESS_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "hexgrad/Kokoro-82M",
"input": "The first Featherless speech request is ready.",
"voice": "af_bella",
"response_format": "wav",
"speed": 1
}' \
--output speech.audio \
--write-out "Content-Type: %{content_type}\n"Check the returned Content-Type before choosing a file extension. response_format is a request, not a guarantee. MP3 and WAV requests are always accepted, but a model with a fixed output format returns its native container: audio is only ever rewrapped from PCM to WAV, never transcoded between codecs.
4. Request a self-describing JSON response
curl --fail-with-body https://api.featherless.ai/v1/audio/speech \
--header "Authorization: Bearer $FEATHERLESS_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "hexgrad/Kokoro-82M",
"input": "Return this clip inside JSON.",
"voice": "af_bella",
"delivery": "json"
}'JSON delivery returns the actual audio format, measured usage, and a base64-encoded audio value. Decode that value before writing it to an audio file.
Next steps
Read the endpoint reference for every request and response field. Use the voices and cloning guide before sending reference audio, and use the selected model guide before adding dialogue or expression syntax.