FonadaLabs
Login / Sign Up

Klone V3 Flash

Recommended · Streaming

Klone V3 Flash (klone_v3_flash) is our fast, streaming voice-clone model and the recommended model on the Text to Speech API. It speaks in any Voice Arena voice, in 12 languages, as one-shot audio, a chunked HTTP stream, or over a WebSocket. It replaces Klone V2 Flash at the same price. For 48 languages, use Klone V2 Pro.

Quick start

  1. 1

    Get an API key

    Create a key in the Console and replace YOUR_API_KEY in the examples below.

  2. 2

    Install the SDK

    pip install -U "fonadalabs>=4.0"
  3. 3

    Make your first request

    Generate speech in a Voice Arena voice with Klone V3 Flash. Replace YOUR_SHARE_ID with the voice's 8-character share ID.

    from fonadalabs.tts.client import TTSClient
    
    client = TTSClient(api_key="YOUR_API_KEY")
    
    audio_bytes = client.generate_audio(
        text="नमस्ते, यह एक परीक्षण है।",
        language="Hindi",        # required
        model="klone_v3_flash",  # required
        share_id="YOUR_SHARE_ID",
        output_file="out.wav",
    )

Overview

Key characteristics

  • Three ways to call it: one-shot POST /v1/text-to-speech, chunked POST /v1/text-to-speech/stream, and WSS /v1/text-to-speech/ws.
  • Streaming starts playing fast: the first audio arrives in about 0.2 to 0.5 s.
  • 12 languages: Bengali, English, Gujarati, Hindi, Kannada, Malayalam, Marathi, Odia, Punjabi, Tamil, Telugu, Urdu.
  • Up to 5,000 characters per request.
  • speed, duration, instruct and num_step apply on /stream and /ws. One-shot Flash ignores them.

Request

API endpoint

Base URL: https://api.fonada.ai
Endpoint: /v1/text-to-speech (one-shot) or /v1/text-to-speech/stream
Method: POST
Content-Type: multipart/form-data (form fields, not JSON)
Authorization: Bearer YOUR_API_KEY

curl
curl -X POST "https://api.fonada.ai/v1/text-to-speech" \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "model=klone_v3_flash" \ -F "share_id=YOUR_SHARE_ID" \ -F "language=hi" \ -F "text=नमस्ते, यह एक परीक्षण है।" \ -F "output_audio_codec=mp3" \ -o out.mp3
JavaScript (fetch, server-side)
const form = new FormData() form.append('model', 'klone_v3_flash') form.append('share_id', 'YOUR_SHARE_ID') form.append('language', 'hi') form.append('text', 'नमस्ते, यह एक परीक्षण है।') form.append('output_audio_codec', 'mp3') // optional, default wav // Call from your backend, not the browser: keep your API key server-side. // Do not set Content-Type yourself - FormData adds the multipart boundary. const res = await fetch('https://api.fonada.ai/v1/text-to-speech', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY' }, body: form, }) if (!res.ok) { const err = await res.json() // { detail: { error, message, details? } } if (err?.detail?.error === 'rate_limit_exceeded') { const wait = err.detail.details?.retry_after_seconds ?? 5 // wait `wait` seconds, then retry } throw new Error(err?.detail?.message || err?.detail || 'text-to-speech failed') } console.log('credits used:', res.headers.get('X-Credits-Used')) const audio = Buffer.from(await res.arrayBuffer())

Parameters (multipart form)

FieldRequiredDefaultDescription
textYes—Text to synthesize, 1 to 5,000 characters. Missing or empty: 400 empty_text.
modelYes—klone_v3_flash. Missing or empty: 400 missing_model. Send it on every call, including stream and WebSocket.
languageYes—Code (hi), name (Hindi) or tag (hi-IN). Missing or empty: 400 missing_language. See Languages.
share_idOne voice source—Catalog voice, 8 characters (same as the old API).
audioOne voice source—Reference clip upload: WAV/MP3/M4A/FLAC/OGG/WebM, up to 10 MB and 30 s. Enterprise only.
audio_urlOne voice source—HTTPS URL of a reference clip. Enterprise only.
audio_textNoautoTranscript of audio / audio_url. Ignored with share_id.
output_audio_codecNowav (stream: pcm)See Output formats.
speedNo1.00.25 to 4.0. Stream and WebSocket only.
durationNo—0.1 to 60 s; overrides speed. Stream and WebSocket only.
instructNo—Style, e.g. "calm, whispering". Stream and WebSocket only.
num_stepNo328 to 64. Stream and WebSocket only.
Send exactly one voice source: share_id, audio or audio_url. Zero returns 400 missing_audio_source; more than one returns 400 ambiguous_audio_source. Normal users use share_id.

Response

The body of a successful response is the audio. Read it as a Blob or ArrayBuffer, not JSON. Content-Type follows the codec.

HeaderMeaning
X-Modelklone_v3_flash
X-Request-IdRequest ID. Log it and quote it to support
X-Credits-UsedCredits charged for this request
X-Output-CodecCodec returned
X-Processing-Time-Ms, X-Upstream-Time-MsTiming

Browsers cannot read X-Model, X-Credits-Used or X-Request-Id yet (they are not exposed through CORS). Read them in your backend.

Streaming

POST /v1/text-to-speech/stream takes the same form fields and returns chunked audio. Start playing as soon as bytes arrive. The default codec is pcm (16-bit, 24 kHz, mono). Always send model=klone_v3_flash.

JavaScript (fetch, server-side)
const form = new FormData() form.append('model', 'klone_v3_flash') form.append('share_id', shareId) form.append('language', 'hi') form.append('text', text) form.append('output_audio_codec', 'mp3') // stream default is pcm const res = await fetch('https://api.fonada.ai/v1/text-to-speech/stream', { method: 'POST', headers: { Authorization: `Bearer ${apiKey}` }, // call from your backend, not the browser body: form, }) if (!res.ok) throw new Error((await res.json()).detail?.error) const reader = res.body.getReader() for (;;) { const { value, done } = await reader.read() if (done) break // append value (Uint8Array) to your audio buffer / MediaSource }
HeaderMeaning
X-Modelklone_v3_flash
X-Request-IdRequest ID
X-Credits-UsedCredits charged
X-Output-Codec, X-Sample-Rate, X-ChannelsAudio format, e.g. pcm, 24000, 1
  • Error before audio starts: a normal JSON error, and the credits are refunded.
  • Error after audio starts: the stream ends early, and the request is billed.

WebSocket

Connect to wss://api.fonada.ai/v1/text-to-speech/ws with the Authorization: Bearer header, or add ?api_key=YOUR_API_KEY where headers cannot be set. Do not put a customer's real key in browser code.

Server sends once on connect
{"type":"ready","model":"klone_v3_flash","codecs":["pcm","wav","mp3","opus","mulaw","alaw"], "default_codec":"pcm","sample_rate":24000,"channels":1}
Client sends one JSON message per utterance
{"text":"नमस्ते","share_id":"YOUR_SHARE_ID","language":"hi","output_audio_codec":"pcm", "model":"klone_v3_flash","request_id":"optional-your-id", "speed":1.0,"duration":null,"instruct":null,"num_step":null}

Send text, share_id, model (klone_v3_flash) and language in every message; the rest are optional. klone_v2_pro returns an error. For each utterance the server sends a start message, then binary frames with the audio, then an end message.

start
{"type":"start","request_id":"...","model":"klone_v3_flash","output_audio_codec":"pcm", "sample_rate":24000,"channels":1,"credits_used":1.65}
end
{"type":"end","request_id":"...","audio_bytes":151680,"first_audio_ms":182,"total_ms":900}
error
{"type":"error","request_id":"...","status":400,"error":"invalid_language","message":"..."}
  • The connection stays open after an error, so you can send the next utterance.
  • Utterances are processed in order, one at a time.
  • An idle connection closes after 300 s.
  • A bad key gets an error message, then the connection closes with code 1008.

Languages (12)

Pass a code, a name or a tag (case-insensitive). Anything else returns 400 invalid_language. Odia is or on Flash (ory on Pro); the name "Odia" works on both.

CodeLanguage
bnBengali
enEnglish
guGujarati
hiHindi
knKannada
mlMalayalam
mrMarathi
orOdia
paPunjabi
taTamil
teTelugu
urUrdu

Output formats

output_audio_codecFormatSample rateContent-Type
wav (one-shot default)WAV 16-bit mono24 kHzaudio/wav
pcm (alias linear16, stream default)Raw s16le mono, no header24 kHzaudio/pcm
mp3MP3 128 kbps24 kHzaudio/mpeg
opusOgg Opus24 kHzaudio/ogg
mulaw (alias ulaw)μ-law8 kHzaudio/basic
alawA-law8 kHzaudio/x-alaw-basic

For browser playback use mp3 or wav; pcm needs the Web Audio API. pcm, mulaw and alaw have no header, so your player needs to be told the format. An unknown value returns 400 invalid_output_audio_codec.

Pricing

Priced per 10K characters, billed per character of input text. Klone V3 Flash costs the same as Klone V2 Flash did.

ModelPriceCreditsBilling
Klone V3 Flash₹6 per 10K characters~500 creditsBilled per character
  • credits = max(round(characters ÷ your Flash rate × voice multiplier, 2), 0.01).
  • Paid Voice Arena voices (2x or higher) multiply this rate. Uploaded and URL voices are billed at 1x.
  • Credits are taken when the request starts and refunded if it fails (for /stream, only if it fails before any audio).

See the full pricing page.

Rate limits

  • Limits are per API key. The free tier allows 10 requests per minute.
  • The wait time is in the body (detail.details.retry_after_seconds).
429 response body
{ "detail": { "error": "rate_limit_exceeded", "message": "Rate limit exceeded. You can make 10 requests per minute.", "details": { "rate_limit": 10, "current_usage": 10, "remaining": 0, "retry_after_seconds": 37, "rate_period": "minute" } } }

Errors

Errors are JSON: {"detail": {"error": "<code>", "message": "<text>"}}. On the WebSocket the same fields are flat inside {"type":"error", ...}. Two exceptions: 401 returns a plain-string detail, and 422 returns a FastAPI list, so handle both. Required fields are checked in this order: API key (401), then model, then language.

HTTPerrorCause
400missing_modelmodel missing or empty (required, including in each WebSocket message). supported_models lists the choices. Nothing is charged
400missing_languagelanguage missing or empty (required, including in each WebSocket message). Nothing is charged; on the WebSocket the connection stays open
400invalid_modelmodel is not klone_v3_flash or klone_v2_pro (supported_models lists them). klone_v2_flash is not accepted
400streaming_not_supportedklone_v2_pro sent to /stream or /ws
400empty_text / text_too_longtext is missing, or longer than 5,000 characters
400missing_audio_source / ambiguous_audio_sourceNo voice source, or more than one of share_id / audio / audio_url
400invalid_languageLanguage is not one of the 12 Flash languages
400invalid_output_audio_codecUnknown codec
400invalid_speed / invalid_duration / invalid_num_stepOut of range on /stream or /ws
400empty_audio / audio_decode_failed / audio_too_long / audio_text_requiredReference clip problems
401plain-text detail, e.g. "Invalid API key"Missing or invalid key
403enterprise_onlyaudio / audio_url on a non-enterprise key
403inactive_api_key / access_deniedAccount problems
404voice_not_foundUnknown share_id
413audio_too_largeReference clip over 10 MB
422FastAPI list in detailField type or range wrong on one-shot
429rate_limit_exceededPer-key limit (free tier: 10 per minute); see details.retry_after_seconds
429credits_exhaustedBalance too low; see details.current_balance and details.estimated_cost
500 / 502upstream_error / upstream_unreachable / upstream_empty / internal_errorServer side; retry, quoting X-Request-Id

Python SDK

Flash and Pro share the same TTSClient. Always pass model="klone_v3_flash" and language: both are required on every call. Use generate_audio() for a file and stream_audio() to play while generating. See the Klone V2 Pro SDK section for authentication.

install
pip install -U "fonadalabs>=4.0"

Upgrading from SDK 3.x

  • Run pip install -U "fonadalabs>=4.0".
  • Add model= to every call; it is required now.
  • klone_v2_flash → klone_v3_flash
  • v2 (Pro) → klone_v2_pro
  • ASR v3 → kapture_v3_1
  • last_stream_info.credits_charged → last_stream_info.credits_used
Python SDK: generate
from fonadalabs.tts.client import TTSClient client = TTSClient(api_key="YOUR_API_KEY") audio_bytes = client.generate_audio( text="नमस्ते, यह एक परीक्षण है।", language="Hindi", # required model="klone_v3_flash", # required share_id="YOUR_SHARE_ID", output_file="out.wav", )
Python SDK: stream
import wave from fonadalabs.tts.client import TTSClient client = TTSClient(api_key="YOUR_API_KEY") # Streams 16-bit PCM, 24 kHz, mono as it is generated with wave.open("stream.wav", "wb") as wav: wav.setnchannels(1) wav.setsampwidth(2) wav.setframerate(24000) for chunk in client.stream_audio( "नमस्ते, यह एक परीक्षण है।", model="klone_v3_flash", # required share_id="YOUR_SHARE_ID", language="Hindi", # required ): wav.writeframes(chunk) print(client.last_stream_info.credits_used)
Python SDK: WebSocket session
import asyncio from fonadalabs import TTSClient async def main(): client = TTSClient(api_key="YOUR_API_KEY") async with client.stream_session() as session: async for chunk in session.speak( "नमस्ते", language="Hindi", model="klone_v3_flash", share_id="YOUR_SHARE_ID" ): ... # play or save chunk (16-bit PCM, 24 kHz, mono) print(session.last_info.credits_used) asyncio.run(main())

Deprecated

The following still work but are deprecated. Do not use them in new code.

  • Klone V2 Flash (klone_v2_flash): replaced by Klone V3 Flash. Not accepted on the new endpoints (400 invalid_model).
  • POST /v1/voice-clone/chunks → POST /v1/text-to-speech
  • POST /v1/voice-clone/stream → POST /v1/text-to-speech/stream
  • WSS /v1/voice-clone/ws → WSS /v1/text-to-speech/ws
  • share_id stays the same; X-Credits-Charged / credits_charged → X-Credits-Used / credits_used

FAQ

Both use POST /v1/text-to-speech with the same voices, headers and errors; the model field picks the model. Flash is faster, supports 12 languages, and is the only model that can stream (/stream and /ws). Pro supports 48 languages and is one-shot only. Flash costs a tenth of Pro; see Pricing.