Skip to content
QuickvoiceBeta

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.

  1. Open a WebSocket, set the voice, and forward text as your LLM writes it. Send flush when the reply is complete. Drop the api_key parameter 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" }));
  2. 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 AudioContext from 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;
  3. 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

Messages the client sends
typeFieldsMeaning
configvoice, speedSets the voice and speed for the text that follows, for example {"type":"config","voice":"af_heart","speed":1.0}.
texttextA piece of text. Send it as it is produced: partial sentences and single tokens are fine.
flushnoneEnd of turn. Whatever text is still waiting gets spoken.
cancelnoneBarge-in. Stops the current turn and drops what was queued.

Server to client

Messages the server sends
typeFieldsMeaning
readysample_rate, format, voicesSent once after connecting: {"type":"ready","sample_rate":24000,"format":"pcm_s16le","voices":[...]}.
chunktext, synth_ms, audio_msOne 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 framenone16-bit little-endian mono PCM at 24 kHz, 200 ms per frame. Frames belong to the chunk message before them.
donenoneThe turn is complete: every clause up to the flush has been sent.
cancellednoneConfirms a cancel. Audio for the cancelled turn has stopped.
errorcode, messagecode 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 cancel and 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 until cancelled comes 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.

Fields of the POST /tts body
FieldTypeMeaning
textstringThe text to speak.
voicestringA voice id from GET /voices, for example af_heart.
speednumberSpeaking 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.wav

Voices

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.

Where the key goes for each interface
InterfaceHow to send the keyWithout a key
WebSocket /wsQuery parameter: /ws?api_key=qv_...Demo tier
POST /ttsHeader: Authorization: Bearer qv_...Send a key
MCP /mcpHeader: 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 error message with code limit and 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 allowances
PlanPriceCharacters
Free$0100k characters/month
Starter$9/month2M characters
Pro$29/month10M characters
Extra usage$4 per 1M characters1M 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.

MCP tools
ToolArgumentsReturns
speaktext, optional voice, optional speedThe audio, plus a short-lived link to it.
list_voicesnoneThe 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/mcp

Add --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.

  1. Open Customize, then Connectors.
  2. Choose + Add, then Add custom connector.
  3. Give it a name, for example Quickvoice, and paste https://quickvoice-api.msrisktec.co.in/mcp as the server URL.
  4. Under Authentication, pick No sign in. The endpoint does not use OAuth.
  5. If you have a key, add a request header named Authorization with the value Bearer qv_.... Without it the connector runs on the demo tier.
  6. 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_..."
      }
    }
  }
}