Skip to main content

Voice Pipeline Quickstart

This guide shows how to chain PolarGrid’s three voice endpoints into a complete pipeline: transcribe speech, generate a response, and synthesize it back to audio — all on the same edge network.
All three models (Whisper, Qwen 3.5, Kokoro) run on the same edge node. No cross-provider latency, one auth token, one bill.

Prerequisites

  • A PolarGrid API key (get one here)
  • An audio file to transcribe (WAV, MP3, FLAC, M4A, OGG, or WebM)
  • Node.js 18+ or Python 3.10+

The Pipeline

JavaScript

Python

cURL

Expected Latency

From a nearby region (e.g., Eastern North America → Toronto):
For real-time bidirectional voice (phone calls, live agents), see PersonaPlex — it handles the full pipeline over a single WebSocket with streaming in both directions.

Audio Format Notes

The examples above use response_format: "pcm" because real-time voice pipelines benefit from the lowest first-byte latency — PCM streams chunk-by-chunk, while wav and mp3 are buffered until the full clip is synthesized. If you’d rather get a playable file back directly, ask the server for a container:
pcm, wav, and mp3 are the supported values. See TTS API → Audio Format for the full content-type / streaming table. For HTTP-only stacks that can’t pipe raw PCM chunks, set stream: true and response_format: 'opus' — same TTFB, smaller bytes on the wire. See the TTS API streaming section for the full contract.

Next Steps

Voice AI Guide

Detailed TTS and STT endpoint reference

PersonaPlex

Real-time bidirectional voice agent over WebSocket

Streaming

Stream LLM tokens as they generate

Models

Available models and specifications