Build voice assistants and live chat with sub-second latency. Natural conversations powered by WebSockets.
Build Siri-like experiences with natural, responsive voice interaction.
24/7 voice support agents that handle calls naturally.
Real-time speech translation for multilingual conversations.
Voice-enabled game characters with dynamic dialogue.
Interactive tutors for pronunciation and conversation practice.
Voice interfaces for users who can't use traditional inputs.
// Connect to Realtime API const ws = new WebSocket("wss://api.mythicdot.ai/v1/realtime", [ "realtime", `mythicdot-api-key.${API_KEY}` ]); ws.onopen = () => { // Configure session ws.send(JSON.stringify({ type: "session.update", session: { modalities: ["text", "audio"], voice: "nova", instructions: "You are a helpful voice assistant." } })); }; // Send audio from microphone ws.send(JSON.stringify({ type: "input_audio_buffer.append", audio: base64AudioChunk })); // Receive audio responses ws.onmessage = (event) => { const data = JSON.parse(event.data); if (data.type === "response.audio.delta") { playAudio(data.delta); // Stream to speakers } };
Use a region close to your users. Enable Voice Activity Detection (VAD) to automatically detect when users stop speaking. Buffer audio in 20-100ms chunks for optimal streaming. Use the response.cancel event if the user interrupts.