OFFRE LIMITÉE : Obtenez 50 % de réduction la première année ! Code LAUNCH50 En profiter →

1-833-GOSITEME Appelez-nous 24 h/24, 7 j/7 - Sans frais
1-833-GOSITEME
Sans frais 24/7
Hébergement IA Token Packs SSL Certificates Training Server Support Configurer serveur IA
GoCodeMe en ligne Télécharger l'éditeur Alfred AI — 1,290+ Tools Voice & AI Products — From $3/mo
Répertoire d'outils Marché Tarifs À propos Cas d'utilisation Comparer Entreprise Documentation Journal des changements Fleet Dashboard Conference Rooms API Reference Getting Started Developer Portal Extensions IVR Builder Agent Templates Conversations Team Workspace SDKs Webhooks Analytics Creator Dashboard Help Center Security
Power-Up Add-Ons Domaines Actualités Contact Affiliate Program — Earn 20%
English Connexion Commencer
Docs Voice Integration

Voice Integration

Integrate Alfred's voice-first AI into your applications. Support for phone calls, web widgets, webhooks, and multiple voice engines.

Architecture Overview

Alfred Voice uses VAPI as the real-time voice transport layer. Calls come in via phone or web widget, get processed through VAPI, and route to Alfred's tool engine for execution.

Voice Call Flow

User (Phone/Web)
VAPI Transport
Alfred Webhook
Tool Engine (1,290+)
Voice Response

STT → Alfred Processing → TTS, with real-time tool execution in the middle

Key Components

VAPI Setup

VAPI handles the real-time voice connection between users and Alfred. You'll need to configure a VAPI assistant and point it to your Alfred webhook.

Step 1: Create a VAPI Account

Sign up at vapi.ai and obtain your API key from the dashboard.

Step 2: Create an Assistant

cURL
curl -X POST https://api.vapi.ai/assistant \
  -H "Authorization: Bearer vapi_key_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Alfred AI",
    "model": {
      "provider": "custom-llm",
      "url": "https://gositeme.com/api/vapi-webhook.php",
      "model": "alfred-v2"
    },
    "voice": {
      "provider": "cartesia",
      "voiceId": "sonic-english-male-1"
    },
    "firstMessage": "Hello! I am Alfred, your AI assistant. How can I help you today?",
    "serverUrl": "https://gositeme.com/api/vapi-webhook.php"
  }'

Step 3: Configure Server URL

Point your VAPI assistant's server URL to Alfred's webhook endpoint:

POST /api/vapi-webhook.php

This endpoint receives all VAPI events: call start, speech input, tool calls, and call end.

Managed Setup: If you're using Alfred's hosted service, VAPI is pre-configured. You only need manual setup when self-hosting or customizing the voice pipeline.

Webhook Configuration

Alfred exposes multiple webhook endpoints for voice event handling:

EndpointPurpose
/api/vapi-webhook.phpMain VAPI event handler (call events, messages, tool calls)
/api/vapi-callback.phpCallback handler for async tool results
/api/vapi-tools.phpTool registration endpoint for VAPI function calling
/api/vapi-auth.phpVoice session authentication
/api/vapi-outbound.phpOutbound call initiation

Webhook Event Types

The main webhook receives events in this format:

JSON
// Call started
{
  "message": {
    "type": "assistant-request",
    "call": {
      "id": "call_abc123",
      "phoneNumber": "+18334674836",
      "customer": { "number": "+15145551234" }
    }
  }
}

// Tool call request
{
  "message": {
    "type": "tool-calls",
    "toolCalls": [
      {
        "id": "tc_xyz",
        "type": "function",
        "function": {
          "name": "weather_lookup",
          "arguments": "{\"location\":\"Montreal\"}"
        }
      }
    ]
  }
}

// Call ended
{
  "message": {
    "type": "end-of-call-report",
    "call": { "id": "call_abc123" },
    "summary": "User asked about weather in Montreal",
    "duration": 45
  }
}

Handling Webhook Events (PHP)

PHP
<?php
// vapi-webhook.php - Handle incoming VAPI events
$payload = json_decode(file_get_contents('php://input'), true);
$type = $payload['message']['type'] ?? '';

switch ($type) {
    case 'assistant-request':
        // New call - return assistant configuration
        echo json_encode([
            'assistant' => [
                'firstMessage' => 'Hello! I am Alfred. How can I help?',
                'model' => [
                    'provider' => 'openai',
                    'model' => 'gpt-4',
                    'systemMessage' => 'You are Alfred, an AI assistant with 1,290+ tools...'
                ],
                'voice' => ['provider' => 'cartesia', 'voiceId' => 'sonic-english-male-1']
            ]
        ]);
        break;

    case 'tool-calls':
        // Execute tool calls
        $results = [];
        foreach ($payload['message']['toolCalls'] as $tc) {
            $args = json_decode($tc['function']['arguments'], true);
            $result = executeAlfredTool($tc['function']['name'], $args);
            $results[] = [
                'toolCallId' => $tc['id'],
                'result' => json_encode($result)
            ];
        }
        echo json_encode(['results' => $results]);
        break;

    case 'end-of-call-report':
        // Log call summary
        logCall($payload['message']);
        echo json_encode(['success' => true]);
        break;
}
?>

Phone Number Provisioning

Alfred's primary phone number is 1-833-GOSITEME (1-833-467-4836). For custom phone numbers, provision through VAPI or the voice management API:

Provision a Number

POST /api/voice-manage.php
JavaScript
const number = await fetch('https://gositeme.com/api/voice-manage.php', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer sess_abc123...'
  },
  body: JSON.stringify({
    action: 'provision_number',
    area_code: '514',
    country: 'CA',
    agent_id: 'agent_xyz'
  })
}).then(r => r.json());

console.log(number);
// { phone_number: "+15141234567", status: "active", agent: "agent_xyz" }

List Your Numbers

cURL
curl -H "Authorization: Bearer sess_abc123..." \
  "https://gositeme.com/api/voice-manage.php?action=list_numbers"

# {
#   "numbers": [
#     { "number": "+15141234567", "agent": "agent_xyz", "calls_today": 23, "status": "active" }
#   ]
# }

Initiate Outbound Call

POST /api/vapi-outbound.php
Python
import requests

call = requests.post('https://gositeme.com/api/vapi-outbound.php',
    headers={'Authorization': 'Bearer sess_abc123...'},
    json={
        'action': 'call',
        'to': '+15145551234',
        'from_number': '+15141234567',
        'agent_id': 'agent_xyz',
        'context': 'Follow up on support ticket #1234'
    }
).json()

print(f"Call initiated: {call['call_id']}")
Compliance: Outbound calls must comply with TCPA/CRTC regulations. Ensure you have consent before initiating automated calls. Enterprise plan required for outbound calling.

Voice Agent Configuration

Voice agents are AI personalities that interact with callers. Configure their personality, tools, knowledge base, and voice settings.

Create a Voice Agent

JavaScript
const agent = await fetch('https://gositeme.com/api/fleet.php', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer sess_abc123...'
  },
  body: JSON.stringify({
    action: 'create_agent',
    name: 'Receptionist',
    personality: 'Professional, warm receptionist for a law firm. Always ask for caller name and purpose.',
    tools: ['schedule_appointment', 'lookup_client', 'transfer_call', 'take_message'],
    knowledge_base: 'kb_firm_info',
    voice_enabled: true,
    voice_engine: 'cartesia',
    voice_config: {
      voice_id: 'sonic-english-female-1',
      speed: 1.0,
      emotion: 'friendly'
    },
    call_settings: {
      max_duration: 600,
      silence_timeout: 10,
      greeting: 'Thank you for calling Smith & Associates. How may I direct your call?'
    }
  })
}).then(r => r.json());

Agent Configuration Reference

FieldTypeDescription
personalitystringSystem prompt defining agent behavior and tone
toolsarrayTool names the agent can invoke during calls
knowledge_basestringKnowledge base ID for RAG-powered responses
voice_enginestringTTS engine: kokoro, orpheus, cartesia, elevenlabs
voice_config.voice_idstringSpecific voice ID from chosen engine
voice_config.speedfloatSpeech speed multiplier (0.5–2.0, default: 1.0)
call_settings.max_durationintegerMax call duration in seconds (default: 600)
call_settings.silence_timeoutintegerHang up after N seconds of silence (default: 10)
call_settings.greetingstringFirst message spoken when call connects

Supported Voice Engines

Alfred supports multiple text-to-speech engines. Choose based on your needs for latency, quality, and expressiveness.

Kokoro
Ultra-fast, open-source TTS. Great for real-time interactions with minimal latency.
Fastest
Orpheus
High-quality open-source voice with natural prosody and emotional range.
Expressive
Cartesia Sonic
Low-latency commercial TTS with excellent voice cloning and consistent quality.
Best Balance
ElevenLabs
Premium voice synthesis with the most natural-sounding output. Voice cloning available.
Premium

Engine Comparison

EngineLatencyQualityLanguagesPlan Required
kokoro~80msGoodEN, FR, ES, DE, JAAll plans
orpheus~150msVery GoodEN, FR, ESAll plans
cartesia~120msExcellentEN, FR, ES, DE, PT, JA, KOProfessional+
elevenlabs~200msPremium29 languagesEnterprise

Setting a Voice Engine

JavaScript
// Update agent voice engine
await fetch('https://gositeme.com/api/fleet.php', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer sess_abc123...'
  },
  body: JSON.stringify({
    action: 'update_agent',
    agent_id: 'agent_xyz',
    voice_engine: 'cartesia',
    voice_config: {
      voice_id: 'sonic-english-female-1',
      speed: 1.1,
      emotion: 'professional'
    }
  })
});
Python
import requests

requests.post('https://gositeme.com/api/fleet.php',
    headers={'Authorization': 'Bearer sess_abc123...'},
    json={
        'action': 'update_agent',
        'agent_id': 'agent_xyz',
        'voice_engine': 'elevenlabs',
        'voice_config': {
            'voice_id': 'rachel',
            'stability': 0.7,
            'similarity_boost': 0.8
        }
    }
)

Web Voice Widget

Embed Alfred's voice widget in your website for browser-based voice interaction. The widget handles microphone access, speech-to-text, and real-time responses.

Quick Embed

HTML
<!-- Add to your page's <body> -->
<script src="https://gositeme.com/assets/js/alfred-voice-widget.js"></script>
<script>
  AlfredVoice.init({
    token: 'sess_abc123...',       // Your session token
    position: 'bottom-right',       // bottom-right, bottom-left, top-right, top-left
    theme: 'dark',                  // dark or light
    accent: '#6c5ce7',              // Widget accent color
    greeting: 'Hi! How can I help you today?',
    agent_id: 'agent_xyz',          // Optional: use specific agent
    voice_engine: 'kokoro',         // TTS engine
    tools: ['weather_lookup', 'dns_lookup', 'summarize_text'],  // Allowed tools
    onReady: () => console.log('Widget loaded'),
    onMessage: (msg) => console.log('Alfred said:', msg.text),
    onError: (err) => console.error('Voice error:', err)
  });
</script>

Widget API

JavaScript
// Programmatic control
AlfredVoice.open();              // Open the widget
AlfredVoice.close();             // Close the widget
AlfredVoice.startListening();    // Start microphone
AlfredVoice.stopListening();     // Stop microphone
AlfredVoice.speak('Hello!');     // Text-to-speech
AlfredVoice.sendText('What is the weather in Montreal?');  // Send text input
AlfredVoice.destroy();           // Remove widget from DOM

// Event listeners
AlfredVoice.on('callStart', (data) => { /* call connected */ });
AlfredVoice.on('callEnd', (data) => { /* call ended */ });
AlfredVoice.on('transcript', (text) => { /* user speech recognized */ });
AlfredVoice.on('toolCall', (tool) => { /* tool being executed */ });

Custom Styling

CSS
/* Override widget styles */
.alfred-voice-widget {
    --av-bg: #12121e;
    --av-accent: #6c5ce7;
    --av-text: #e8e8f0;
    --av-radius: 16px;
    --av-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.alfred-voice-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.alfred-voice-panel {
    width: 380px;
    max-height: 500px;
}

Conference Room API

Conference rooms allow multiple AI agents and human participants to collaborate in real-time voice sessions. Useful for multi-agent workflows, team meetings with AI support, and complex problem-solving.

Create a Room

POST /api/fleet.php
JavaScript
const room = await fetch('https://gositeme.com/api/fleet.php', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer sess_abc123...'
  },
  body: JSON.stringify({
    action: 'create_room',
    name: 'Strategy Session',
    agents: ['agent_analyst', 'agent_researcher', 'agent_writer'],
    max_participants: 10,
    recording: true,
    auto_transcribe: true
  })
}).then(r => r.json());

console.log(room);
// {
//   id: "room_abc",
//   name: "Strategy Session",
//   join_url: "https://gositeme.com/conference-room.php?id=room_abc",
//   agents: 3,
//   recording: true
// }

Join a Room

JavaScript
// Via web browser
window.location.href = room.join_url;

// Via API (add participant)
await fetch('https://gositeme.com/api/fleet.php', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer sess_abc123...'
  },
  body: JSON.stringify({
    action: 'join_room',
    room_id: 'room_abc',
    participant: {
      name: 'John Doe',
      role: 'moderator'
    }
  })
});

Room Management

cURL
# Get room status
curl -H "Authorization: Bearer sess_abc123..." \
  "https://gositeme.com/api/fleet.php?action=room_status&room_id=room_abc"

# End room and get transcript
curl -X POST https://gositeme.com/api/fleet.php \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sess_abc123..." \
  -d '{"action":"end_room","room_id":"room_abc"}'

# Response includes transcript and recording URL
# {
#   "transcript": "...",
#   "recording_url": "https://gositeme.com/recordings/room_abc.mp3",
#   "duration": 1847,
#   "participants": 5,
#   "tools_used": 12
# }
Try It Live: Visit gositeme.com/conference-room.php to create a conference room with multiple AI agents right now.
Need Help? For voice integration support, contact support@gositeme.com or call 1-833-GOSITEME.

Someone from somewhere

just launched website.com

Just now