veevo.ai

Example Integration

A minimal Node.js backend implementing all three callbacks.

Server

server.js
const express = require('express');
const app = express();
app.use(express.json());

app.post('/calls/start', (req, res) => {
  res.json({
    twilioAccountSid: process.env.TWILIO_ACCOUNT_SID,
    twilioAuthToken: process.env.TWILIO_AUTH_TOKEN,
    openaiApiKey: process.env.OPENAI_API_KEY,
    systemPrompt: 'You are a helpful assistant. Greet the caller warmly.',
    voice: 'marin',
    onToolCallUrl: `${process.env.BASE_URL}/calls/tool`,
    tools: [],
  });
});

app.post('/calls/tool', (req, res) => {
  res.json({ result: `Handled ${req.body.toolName}` });
});

app.post('/calls/end', (req, res) => {
  console.log(`Call ${req.body.callSid} ended - ${req.body.durationSeconds}s`);
  console.log(`Cost: $${req.body.costBreakdown?.totalCost}`);
  res.json({ received: true });
});

app.listen(3001);

Environment Variables

.env
TWILIO_ACCOUNT_SID=AC...
TWILIO_AUTH_TOKEN=...
OPENAI_API_KEY=sk-...
BASE_URL=https://your-backend.com

What Happens on a Call

1Caller dials your Twilio number
2Twilio sends the call to Veevo's engine URL
3Veevo calls your onCallStart endpoint to get configuration
4Veevo connects the caller to OpenAI's Realtime API using your credentials
5When the AI invokes a tool, Veevo calls your onToolCall endpoint
6When the call ends, Veevo calls your onCallEnd endpoint with the full transcript