.env.local, and installs the SDK.1npx @inkibra/voice-cli init
12345678910111213const response = await fetch( "https://inkibra-voice.inkibra.workers.dev/v1/sessions", { method: "POST", headers: { authorization: `Bearer ${process.env.INKIBRA_API_KEY}`, "content-type": "application/json", }, body: JSON.stringify({ voice: "ara" }), }, ); const { token } = await response.json();
1234567891011import LiveVoice from "@inkibra/voice-sdk"; const session = await LiveVoice.connect({ token, prompt: "Help the user complete a safety inspection.", conversation: { starts: "assistant", prompt: "Be concise. Clarify uncertain details before continuing.", }, tools: {}, });
12345session.on("transcript.instantaneous", ({ text }) => updateOptimisticUI(text)); session.on("transcript.canonical", ({ turns }) => saveConversationView(turns)); session.on("floor", ({ owner, assistantAudible }) => updateVoiceUI(owner, assistantAudible)); session.on("phase", ({ phase }) => updateWorkflow(phase)); session.on("error", console.error);
12session.stop(); session.dispose();
voice selects how the agent sounds. prompt describes the job. conversation describes how the exchange should flow. See Voice, Prompts, and Conversation design.