Docs
Quickvoice API
Streaming text-to-speech for live voice conversations. The product is in beta and speaks English only. Everything on this page is served from https://quickvoice-api.msrisktec.co.in.
Quick start
You can try the API before you have a key. Without one, the WebSocket runs on the demo tier: up to 300 characters per turn, rate limited per IP address. To go past that, request an API key.
Open a WebSocket, set the voice, and forward text as your LLM writes it. Send
flushwhen the reply is complete. Drop theapi_keyparameter to use the demo tier.const ws = new WebSocket("wss://quickvoice-api.msrisktec.co.in/ws?api_key=qv_..."); ws.binaryType = "arraybuffer"; ws.onmessage = (event) => { if (typeof event.data !== "string") return play(event.data); // PCM frame const msg = JSON.parse(event.data); if (msg.type === "chunk") console.log(msg.text, msg.synth_ms); }; ws.onopen = async () => { ws.send(JSON.stringify({ type: "config", voice: "af_heart", speed: 1.0 })); for await (const token of llmStream) { ws.send(JSON.stringify({ type: "text", text: token })); } ws.send(JSON.stringify({ type: "flush" })); // end of turn }; // The user started talking: stop the voice. const bargeIn = () => ws.send(JSON.stringify({ type: "cancel" }));Play the binary frames as they arrive. Each one is 200 ms of 16-bit mono PCM at 24 kHz, so the player is a few lines of Web Audio. Create the
AudioContextfrom a click or key press, because browsers block audio until the user has interacted with the page.const ctx = new AudioContext({ sampleRate: 24000 }); let nextTime = 0; let sources = []; let dropping = false; // true between cancel and cancelled function play(arrayBuffer) { if (dropping) return; const pcm = new Int16Array(arrayBuffer); const samples = new Float32Array(pcm.length); for (let i = 0; i < pcm.length; i++) samples[i] = pcm[i] / 32768; const buffer = ctx.createBuffer(1, samples.length, 24000); buffer.copyToChannel(samples, 0); const source = ctx.createBufferSource(); source.buffer = buffer; source.connect(ctx.destination); // Start each frame where the previous one ends. if (nextTime < ctx.currentTime) nextTime = ctx.currentTime + 0.03; source.start(nextTime); nextTime += buffer.duration; sources.push(source); } function bargeIn(ws) { sources.forEach((source) => source.stop()); sources = []; dropping = true; ws.send(JSON.stringify({ type: "cancel" })); } // In ws.onmessage, when msg.type === "cancelled": dropping = false;If you only need a file, skip the socket and make one HTTP call. This one needs a key.
curl -X POST "https://quickvoice-api.msrisktec.co.in/tts" \ -H "Authorization: Bearer qv_..." \ -H "Content-Type: application/json" \ -d '{"text":"Your table is booked for Friday at eight.","voice":"af_heart","speed":1.0,"format":"wav"}' \ --output speech.wav
WebSocket protocol
Connect to wss://quickvoice-api.msrisktec.co.in/ws for the demo tier, or wss://quickvoice-api.msrisktec.co.in/ws?api_key=qv_... with a key. One connection carries any number of turns. Control messages are JSON text frames. Audio is binary frames.
Client to server
| type | Fields | Meaning |
|---|---|---|
config | voice, speed | Sets the voice and speed for the text that follows, for example {"type":"config","voice":"af_heart","speed":1.0}. |
text | text | A piece of text. Send it as it is produced: partial sentences and single tokens are fine. |
flush | none | End of turn. Whatever text is still waiting gets spoken. |
cancel | none | Barge-in. Stops the current turn and drops what was queued. |
Server to client
| type | Fields | Meaning |
|---|---|---|
ready | sample_rate, format, voices | Sent once after connecting: {"type":"ready","sample_rate":24000,"format":"pcm_s16le","voices":[...]}. |
chunk | text, synth_ms, audio_ms | One clause is ready. synth_ms is the time spent synthesising it and audio_ms is the length of its audio. The audio follows in binary frames. |
| binary frame | none | 16-bit little-endian mono PCM at 24 kHz, 200 ms per frame. Frames belong to the chunk message before them. |
done | none | The turn is complete: every clause up to the flush has been sent. |
cancelled | none | Confirms a cancel. Audio for the cancelled turn has stopped. |
error | code, message | code is limit, auth or bad_request. message is written for people and can be shown as it is. |
One turn, in order
Arrows show the direction: → is your client, ← is the server. The numbers in synth_ms and audio_ms depend on the clause, so they are left as placeholders here. The demo on the home page shows real ones.
→ {"type":"config","voice":"af_heart","speed":1.0}
→ {"type":"text","text":"Sure, I can "}
→ {"type":"text","text":"help with that. Your last payment "}
← {"type":"chunk","text":"Sure, I can help with that.","synth_ms":<ms>,"audio_ms":<ms>}
← <binary PCM frames for that clause>
→ {"type":"text","text":"went through on the twelfth."}
→ {"type":"flush"}
← {"type":"chunk","text":"Your last payment went through on the twelfth.","synth_ms":<ms>,"audio_ms":<ms>}
← <binary PCM frames for that clause>
← {"type":"done"}Playback and barge-in
- Schedule each frame to start where the previous one ends. Do not wait for a clause to finish.
- To interrupt, send
canceland stop every audio source you have scheduled. - Frames that were already on their way can still arrive after you send
cancel. Drop every binary frame untilcancelledcomes in, then start the next turn.
HTTP /tts
POST /tts turns one piece of text into audio and streams it back. Use it when nobody is waiting in a live conversation: notifications, pre-rendered prompts, files.
| Field | Type | Meaning |
|---|---|---|
text | string | The text to speak. |
voice | string | A voice id from GET /voices, for example af_heart. |
speed | number | Speaking rate. 1.0 is normal. |
format | "wav" or "pcm" | WAV file, or raw PCM in the same format as the WebSocket frames. |
Send the key in the Authorization header. The response body is the audio, streamed as it is produced. Errors come back as JSON with the reason in detail.
curl -X POST "https://quickvoice-api.msrisktec.co.in/tts" \
-H "Authorization: Bearer qv_..." \
-H "Content-Type: application/json" \
-d '{"text":"Your table is booked for Friday at eight.","voice":"af_heart","speed":1.0,"format":"wav"}' \
--output speech.wavVoices
GET /voices returns the available voices. No key is needed. The first letter of an id is the accent (a for US, b for UK) and the second is the gender. All voices speak English.
[
{ "id": "af_heart", "name": "Heart (US, female)" },
...
]Authentication
Keys start with qv_. They are issued by hand during the beta: request one here.
| Interface | How to send the key | Without a key |
|---|---|---|
| WebSocket /ws | Query parameter: /ws?api_key=qv_... | Demo tier |
| POST /tts | Header: Authorization: Bearer qv_... | Send a key |
| MCP /mcp | Header: Authorization: Bearer qv_... | Demo tier |
A key placed in browser code can be read by anyone who opens the page. For a public web app, open the socket from your own server, or put a small proxy in front of it that adds the key.
Limits
- Demo tier (no key): up to 300 characters per turn, rate limited per IP address.
- Going over a limit on the WebSocket returns an
errormessage with codelimitand a message that says which limit was hit. - English only. Other languages are not available yet.
- The product is in beta. Paid plans are by request and keys are issued manually.
| Plan | Price | Characters |
|---|---|---|
| Free | $0 | 100k characters/month |
| Starter | $9/month | 2M characters |
| Pro | $29/month | 10M characters |
| Extra usage | $4 per 1M characters | 1M characters is roughly 18 hours of speech |
MCP guides
Quickvoice has an MCP endpoint, so an AI assistant can speak through it. The endpoint is https://quickvoice-api.msrisktec.co.in/mcp and uses the Streamable HTTP transport.
| Tool | Arguments | Returns |
|---|---|---|
speak | text, optional voice, optional speed | The audio, plus a short-lived link to it. |
list_voices | none | The available voices. |
Send your key as Authorization: Bearer qv_.... Without a key the endpoint runs on the demo tier, so you can leave the header out while you try it.
Claude Code
Run this once in a terminal. The server is added to the current project.
claude mcp add --transport http quickvoice https://quickvoice-api.msrisktec.co.in/mcp --header "Authorization: Bearer qv_..."To try the demo tier, leave the header out:
claude mcp add --transport http quickvoice https://quickvoice-api.msrisktec.co.in/mcpAdd --scope user to make it available in every project.
Claude Desktop and claude.ai
Add it as a custom connector. The steps are the same in the desktop app and on the web.
- Open Customize, then Connectors.
- Choose + Add, then Add custom connector.
- Give it a name, for example Quickvoice, and paste
https://quickvoice-api.msrisktec.co.in/mcpas the server URL. - Under Authentication, pick No sign in. The endpoint does not use OAuth.
- If you have a key, add a request header named
Authorizationwith the valueBearer qv_.... Without it the connector runs on the demo tier. - Choose Add. In a chat, open the + menu, then Connectors, and switch it on.
Claude reaches custom connectors from Anthropic's servers, not from your computer. The URL above has to be reachable from the public internet over HTTPS; an address on localhost will not connect.
Cursor
Put this in .cursor/mcp.json in your project, or in ~/.cursor/mcp.json to have it in every project. Remove the headers block to use the demo tier.
{
"mcpServers": {
"quickvoice": {
"url": "https://quickvoice-api.msrisktec.co.in/mcp",
"headers": {
"Authorization": "Bearer qv_..."
}
}
}
}