Quick Start

Get voice AI running in 5 minutes

Overview

  1. Create an agent in the dashboard
  2. Choose your mode (Enhanced or Passthrough)
  3. Install the SDK and connect

1. Create an Agent

Sign in to chans.ai and create a new agent:

  1. Go to DashboardNew Agent
  2. Give your agent a Name
  3. Choose your Mode (see below)
  4. Copy the Agent Token (agt_xxx)

Choosing a Mode

ModeBest ForWhat You Need
EnhancedQuick start, prototypesNothing – AI is built-in
PassthroughCustom AI, existing LLMsA 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:

  1. In the dashboard, set your Webhook URL
  2. Your webhook receives POST requests with transcribed speech
  3. Return a JSON response with text to speak
// Express.js example
app.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:

# .env
NEXT_PUBLIC_AGENT_TOKEN=agt_xxx
const { connect } = useVoiceAgent({
agentToken: process.env.NEXT_PUBLIC_AGENT_TOKEN!,
})

Next Steps