🚀 Vaja AI

Early Adopter Documentation - Real-time Voice AI Platform

🎯 Getting Started

What is Vaja AI?

Vaja AI is a real-time voice AI platform that provides:

Access Your Dashboard

  1. Login: Navigate to https://vaja.ai and sign in with your credentials
  2. Dashboard: View current balance, API keys, Voice Lab, and analytics
🎁 Early Adopter Benefits: As an early adopter, you have access to Voice Lab and WebSocket API for building real-time voice applications.

🎙️ Voice Lab (Web Interface)

The Voice Lab is a no-code interface for testing and experimenting with voice AI conversations.

Features

1. Real-time Voice Conversations

Visual Feedback:

2. Language Selection

Choose from 50+ supported languages including:

3. Custom System Prompts

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

4. How to Use Voice Lab

  1. Configure Settings (Optional): Open "Advanced Options", select language and voice
  2. Start Conversation: Check "Continuous Conversation (VAD)", click "Start Conversation"
  3. Talk Naturally: Speak clearly, wait for visual feedback
  4. End Conversation: Click "End Conversation" when done
💡 Tip: Test your prompts in Voice Lab before integrating them into your application.

🔌 WebSocket API (Real-time Voice)

The Voice Lab uses a WebSocket connection for real-time voice streaming. You can integrate this same endpoint into your applications.

Connection Endpoint

WebSocket URL: wss://vaja.ai/ws

Query Parameters

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)

Connection Example

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()}`);

Audio Format Requirements

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

Using Pipecat Client Library

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();
⚠️ Important: Always disconnect when the conversation ends to avoid unnecessary charges.

🔐 Authentication & API Keys

Creating API Keys

  1. Navigate to API Keys: Dashboard → "API Keys" → "Create New API Key"
  2. Configure: Enter name and set rate limit (default: 1000 requests/hour)
  3. Save: Copy the full API key immediately (format: vaja_xxxxx...)
⚠️ Important: You won't be able to see the full key again after creation. Store it securely!

Find Your Organization ID

Best Practices

📊 Usage & Analytics

Access real-time usage data from the "Usage & Billing" page in your dashboard.

Dashboard Analytics Include:

📈 Tip: Dashboard refreshes every 30 seconds for real-time monitoring.

💻 Code Examples

React Component (Browser)

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>
  );
}

Python WebSocket Client

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())

🆘 Support & Resources

Support Channels

Troubleshooting

Connection fails:

No audio input detected:

Poor transcription accuracy:

Getting Help

If you encounter issues, contact support with:

💬 Quick Start: Test in Voice Lab first to isolate whether the issue is platform or integration related.

🚀 Next Steps

Quick Start Checklist

Example Use Cases

Get Started →