Quick Start
Get voice AI running in 5 minutes
Overview
- Create an agent in the dashboard
- Choose your mode (Enhanced or Passthrough)
- Install the SDK and connect
1. Create an Agent
Sign in to chans.ai and create a new agent:
- Go to Dashboard → New Agent
- Give your agent a Name
- Choose your Mode (see below)
- Copy the Agent Token (
agt_xxx)
Choosing a Mode
| Mode | Best For | What You Need |
|---|---|---|
| Enhanced | Quick start, prototypes | Nothing – AI is built-in |
| Passthrough | Custom AI, existing LLMs | A webhook endpoint |
Enhanced Mode includes a managed LLM, conversation memory, and MCP tools. Start here if you want to get running fast.
Passthrough Mode sends transcripts to your webhook and speaks your response. Use this if you have existing AI infrastructure.
2. Install the SDK
npm install @ai-chans/sdk-react
import { useVoiceAgent } from "@ai-chans/sdk-react"
function VoiceButton() { const { state, connect, disconnect } = useVoiceAgent( { agentToken: "agt_xxx" }, { onTranscript: (text) => console.log("User:", text), onResponse: (text) => console.log("Agent:", text), } )
return ( <button onClick={state === "idle" ? connect : disconnect}> {state === "idle" ? "Start" : "Stop"} </button> )}
See React for full API reference.
3. Configure Your Agent
Enhanced Mode
Configure your agent's behavior in the dashboard:
- System Prompt – Instructions for the AI (e.g., "You are a helpful assistant")
- LLM – Choose your language model
- Voice – Choose your TTS voice
- MCP Tools – Connect external tools
That's it – your agent is ready to talk.
Passthrough Mode
Set up a webhook to receive transcripts and return responses:
- In the dashboard, set your Webhook URL
- Your webhook receives POST requests with transcribed speech
- Return a JSON response with text to speak
// Express.js exampleapp.post("/webhook", async (req, res) => { const { transcript } = req.body.data
// Call your LLM (any provider) const response = await yourLLM.generate(transcript)
res.json({ response: response.text })})
See Webhook API for full request/response format.
Environment Variables
For production, use environment variables:
# .envNEXT_PUBLIC_AGENT_TOKEN=agt_xxx
const { connect } = useVoiceAgent({ agentToken: process.env.NEXT_PUBLIC_AGENT_TOKEN!,})
Next Steps
- JavaScript – Core SDK methods and events
- React – React hooks reference
- Webhook API – Passthrough webhook format