This val serves a tiny form: you type a phone number, Vapi rings it, and an AI has a conversation with whoever answers. Vapi hosts the telephony and the live audio bridge to the model, so the whole demo is one POST to https://api.vapi.ai/call — one file, about seventy lines, no imports.
-
Remix this val to get your own copy.
-
Get a Vapi API key — sign up at dashboard.vapi.ai and copy your private key, then paste it as an env var in your val:
-
Create a phone number in the Vapi dashboard (free Vapi numbers work for testing) and copy its ID:
Open the HTTP endpoint of main.ts, type your own number in E.164 format (+15551234567), and hit Call me. Your phone rings and the AI speaks first. Without the env vars set, the page shows a setup reminder instead of erroring.
main.ts— the form, and the onefetchthat places the call
FIRST_MESSAGE,SYSTEM_PROMPT,MODEL, andVOICEat the top ofmain.tscontrol what the AI opens with, how it behaves, and how it sounds.- Call screening (like Google Voice's) answers before you do, so the AI spends its greeting on the screening robot and you join to silence — turn screening off when testing.
- Free Vapi numbers are US-only and meant for testing.
- From here you can add tool calls, transcripts, and post-call analysis — see docs.vapi.ai.
- Only call numbers you have consent to call — automated calls without consent violate TCPA/FCC rules.