Early Adopter Documentation - Real-time Voice AI Platform
Vaja AI is a real-time voice AI platform that provides:
The Voice Lab is a no-code interface for testing and experimenting with voice AI conversations.
Visual Feedback:
Choose from 50+ supported languages including:
Define your AI assistant's behavior and personality:
Example: Restaurant Booking Assistant
You are a helpful restaurant booking assistant for "Rasoi Indian
Restaurant" located in downtown Seattle. Your role is to:
1. Help customers make reservations
2. Answer questions about the menu, hours, and location
3. Provide information about special dietary options
Restaurant Details:
- Name: Rasoi Indian Restaurant
- Location: 123 Pike Street, Seattle, WA
- Hours: Mon-Thu 11am-10pm, Fri-Sat 11am-11pm, Sun 12pm-9pm
- Cuisine: Authentic North Indian cuisine
When taking reservations, always confirm:
- Date and time
- Number of guests
- Name and phone number
The Voice Lab uses a WebSocket connection for real-time voice streaming. You can integrate this same endpoint into your applications.
WebSocket URL: wss://vaja.ai/ws
| Parameter | Required | Description |
|---|---|---|
apiKey |
Required | Your Vaja API key (format: vaja_xxxxx...) |
organizationId |
Required | Your organization ID from dashboard |
agentId |
Optional | Pre-configured agent ID |
systemPrompt |
Optional | Custom AI instructions (URL encoded) |
language |
Optional | Language code (e.g., en, es, fr) |
const params = new URLSearchParams({
apiKey: 'vaja_xxxxxxxxxxxxx',
organizationId: 'org_xxxxxxxxxxxxx',
systemPrompt: 'You are a helpful AI assistant.',
language: 'en'
});
const ws = new WebSocket(`wss://vaja.ai/ws?${params.toString()}`);
| Direction | Sample Rate | Format | Encoding |
|---|---|---|---|
| Input (client → server) | 16kHz (recommended) | WebM, WAV, or raw PCM | Opus codec (WebM) or 16-bit PCM |
| Output (server → client) | 24kHz | MP3 or raw audio | Base64-encoded audio data |
The Voice Lab uses the @pipecat-ai/client-js library, which handles WebSocket communication automatically.
npm install @pipecat-ai/client-js @pipecat-ai/websocket-transport
import { PipecatClient } from '@pipecat-ai/client-js';
import { WebSocketTransport, ProtobufFrameSerializer } from '@pipecat-ai/websocket-transport';
// Build WebSocket URL
const params = new URLSearchParams({
apiKey: 'YOUR_API_KEY',
organizationId: 'YOUR_ORG_ID',
systemPrompt: 'You are a helpful AI assistant.',
language: 'en'
});
const wsUrl = `wss://vaja.ai/ws?${params.toString()}`;
// Initialize transport
const transport = new WebSocketTransport({
wsUrl,
serializer: new ProtobufFrameSerializer(),
recorderSampleRate: 16000,
playerSampleRate: 24000
});
// Initialize client
const client = new PipecatClient({
transport,
enableMic: true,
enableCam: false,
callbacks: {
onConnected: () => console.log('Connected'),
onUserTranscript: (text) => console.log('User:', text),
onBotTranscript: (text) => console.log('AI:', text),
onError: (error) => console.error('Error:', error)
}
});
// Connect
await client.connect();
// Disconnect when done
await client.disconnect();
vaja_xxxxx...)org_xxxxxxxxxxxxxVAJA_API_KEY, VAJA_ORG_IDAccess real-time usage data from the "Usage & Billing" page in your dashboard.
import React, { useState, useRef } from 'react';
import { PipecatClient } from '@pipecat-ai/client-js';
import { WebSocketTransport, ProtobufFrameSerializer } from '@pipecat-ai/websocket-transport';
function VoiceConversation() {
const [isConnected, setIsConnected] = useState(false);
const [transcript, setTranscript] = useState('');
const clientRef = useRef(null);
const startConversation = async () => {
const params = new URLSearchParams({
apiKey: process.env.REACT_APP_VAJA_API_KEY,
organizationId: process.env.REACT_APP_VAJA_ORG_ID,
systemPrompt: 'You are a helpful AI assistant.',
language: 'en'
});
const wsUrl = `wss://vaja.ai/ws?${params.toString()}`;
const transport = new WebSocketTransport({
wsUrl,
serializer: new ProtobufFrameSerializer(),
recorderSampleRate: 16000,
playerSampleRate: 24000
});
const client = new PipecatClient({
transport,
enableMic: true,
callbacks: {
onConnected: () => setIsConnected(true),
onDisconnected: () => setIsConnected(false),
onUserTranscript: (text) => setTranscript(`You: ${text}`),
onBotTranscript: (text) => setTranscript(`AI: ${text}`)
}
});
await client.connect();
clientRef.current = client;
};
const stopConversation = async () => {
if (clientRef.current) {
await clientRef.current.disconnect();
}
};
return (
<div>
<button onClick={isConnected ? stopConversation : startConversation}>
{isConnected ? 'End Conversation' : 'Start Conversation'}
</button>
{isConnected && <p>🟢 Connected</p>}
{transcript && <p>{transcript}</p>}
</div>
);
}
import asyncio
import websockets
from urllib.parse import urlencode
import os
async def voice_conversation():
params = {
'apiKey': os.environ['VAJA_API_KEY'],
'organizationId': os.environ['VAJA_ORG_ID'],
'systemPrompt': 'You are a helpful AI assistant.',
'language': 'en'
}
ws_url = f"wss://vaja.ai/ws?{urlencode(params)}"
async with websockets.connect(ws_url) as websocket:
print("✅ Connected to Vaja AI")
# Send audio chunks (from microphone or file)
with open('audio_input.wav', 'rb') as audio_file:
chunk_size = 4096
while True:
chunk = audio_file.read(chunk_size)
if not chunk:
break
await websocket.send(chunk)
await asyncio.sleep(0.1)
# Receive responses
async for message in websocket:
print(f"Received: {message[:100]}...")
asyncio.run(voice_conversation())
If you encounter issues, contact support with: