npx skills add https://github.com/vapiai/skills --skill create-call使用 Vapi 的 API 发起外拨电话、网页通话和批量通话。将您的语音助手连接到真实的电话号码,并以编程方式进行测试。
设置: 确保已设置
VAPI_API_KEY。如有需要,请参阅setup-api-key技能。
curl -X POST https://api.vapi.ai/call \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"assistantId": "your-assistant-id",
"phoneNumberId": "your-phone-number-id",
"customer": {
"number": "+11234567890"
}
}'
import { VapiClient } from "@vapi-ai/server-sdk";
const vapi = new VapiClient({ token: process.env.VAPI_API_KEY! });
const call = await vapi.calls.create({
assistantId: "your-assistant-id",
phoneNumberId: "your-phone-number-id",
customer: {
number: "+11234567890",
},
});
console.log("Call created:", call.id);
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
import requests
import os
response = requests.post(
"https://api.vapi.ai/call",
headers={
"Authorization": f"Bearer {os.environ['VAPI_API_KEY']}",
"Content-Type": "application/json",
},
json={
"assistantId": "your-assistant-id",
"phoneNumberId": "your-phone-number-id",
"customer": {"number": "+11234567890"},
},
)
call = response.json()
print(f"Call initiated: {call['id']}")
需要一个助手、一个 Vapi 电话号码和一个客户号码。
{
"assistantId": "assistant-id",
"phoneNumberId": "phone-number-id",
"customer": {
"number": "+11234567890",
"name": "John Doe",
"numberE164CheckEnabled": true
}
}
适用于基于浏览器的通话 — 无需电话号码。在客户端使用 Vapi Web SDK。
{
"assistantId": "assistant-id"
}
客户端 (JavaScript):
import Vapi from "@vapi-ai/web";
const vapi = new Vapi("your-public-key");
vapi.start("your-assistant-id");
内联定义一个助手,而不是引用已保存的助手:
{
"assistant": {
"name": "Quick Test",
"firstMessage": "Hello! This is a test call.",
"model": {
"provider": "openai",
"model": "gpt-4.1",
"messages": [
{
"role": "system",
"content": "You are a test assistant. Confirm the call is working and end politely."
}
]
},
"voice": { "provider": "vapi", "voiceId": "Elliot" },
"transcriber": { "provider": "deepgram", "model": "nova-3", "language": "en" }
},
"phoneNumberId": "phone-number-id",
"customer": {
"number": "+11234567890"
}
}
为未来的某个时间安排通话:
{
"assistantId": "assistant-id",
"phoneNumberId": "phone-number-id",
"customer": {
"number": "+11234567890"
},
"schedulePlan": {
"earliestAt": "2025-06-15T14:00:00Z",
"latestAt": "2025-06-15T15:00:00Z"
}
}
earliestAt — 尝试通话的最早时间 (ISO 8601)latestAt — 尝试通话的最晚时间 (可选)assistantId,则在通话时使用该助手的最新版本assistant (临时)在一个请求中拨打多个号码:
{
"assistantId": "assistant-id",
"phoneNumberId": "phone-number-id",
"customers": [
{ "number": "+11234567890", "name": "Alice" },
{ "number": "+10987654321", "name": "Bob" },
{ "number": "+15551234567", "name": "Carol" }
]
}
可与 schedulePlan 结合使用,用于安排批量通话。
传递在通话期间可访问的自定义数据:
{
"assistantId": "assistant-id",
"phoneNumberId": "phone-number-id",
"customer": {
"number": "+11234567890"
},
"metadata": {
"orderId": "ORD-12345",
"department": "billing"
}
}
# 列出通话
curl "https://api.vapi.ai/call?limit=10" \
-H "Authorization: Bearer $VAPI_API_KEY"
# 获取特定通话
curl https://api.vapi.ai/call/{id} \
-H "Authorization: Bearer $VAPI_API_KEY"
# 获取包含转录文本和录音的通话
curl https://api.vapi.ai/call/{id} \
-H "Authorization: Bearer $VAPI_API_KEY"
# 响应包括:transcript, recordingUrl, summary, costBreakdown
# 删除通话
curl -X DELETE https://api.vapi.ai/call/{id} \
-H "Authorization: Bearer $VAPI_API_KEY"
成功创建通话会返回:
{
"id": "call-uuid",
"orgId": "org-uuid",
"type": "outboundPhoneCall",
"status": "queued",
"assistantId": "assistant-id",
"phoneNumberId": "phone-number-id",
"customer": {
"number": "+11234567890"
},
"createdAt": "2025-01-15T10:00:00Z"
}
通话状态:queued → ringing → in-progress → ended
未经同意以自动化方式拨打电话号码违反 FCC 法律。在启动自动通话活动之前,请审查 TCPA 同意要求。
此技能仓库包含一个 Vapi 文档 MCP 服务器 (vapi-docs),它使您的 AI 代理能够访问完整的 Vapi 知识库。使用 searchDocs 工具来查找此技能未涵盖的任何内容 — 高级配置、故障排除、SDK 详细信息等。
自动配置: 如果您克隆或安装了这些技能,MCP 服务器已通过 .mcp.json (Claude Code)、.cursor/mcp.json (Cursor) 或 .vscode/mcp.json (VS Code Copilot) 配置好。
手动设置: 如果您的代理无法自动检测到配置,请运行:
claude mcp add vapi-docs -- npx -y mcp-remote https://docs.vapi.ai/_mcp/server
有关所有受支持代理的完整设置说明,请参阅 README。
每周安装数
291
仓库
GitHub 星标数
22
首次出现
2026年2月19日
安全审计
安装于
cursor259
kimi-cli255
gemini-cli255
github-copilot255
amp255
codex255
Initiate outbound phone calls, web calls, and batch calls using Vapi's API. Connect your voice assistants to real phone numbers and test them programmatically.
Setup: Ensure
VAPI_API_KEYis set. See thesetup-api-keyskill if needed.
curl -X POST https://api.vapi.ai/call \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"assistantId": "your-assistant-id",
"phoneNumberId": "your-phone-number-id",
"customer": {
"number": "+11234567890"
}
}'
import { VapiClient } from "@vapi-ai/server-sdk";
const vapi = new VapiClient({ token: process.env.VAPI_API_KEY! });
const call = await vapi.calls.create({
assistantId: "your-assistant-id",
phoneNumberId: "your-phone-number-id",
customer: {
number: "+11234567890",
},
});
console.log("Call created:", call.id);
import requests
import os
response = requests.post(
"https://api.vapi.ai/call",
headers={
"Authorization": f"Bearer {os.environ['VAPI_API_KEY']}",
"Content-Type": "application/json",
},
json={
"assistantId": "your-assistant-id",
"phoneNumberId": "your-phone-number-id",
"customer": {"number": "+11234567890"},
},
)
call = response.json()
print(f"Call initiated: {call['id']}")
Requires an assistant, a Vapi phone number, and a customer number.
{
"assistantId": "assistant-id",
"phoneNumberId": "phone-number-id",
"customer": {
"number": "+11234567890",
"name": "John Doe",
"numberE164CheckEnabled": true
}
}
For browser-based calls — no phone number needed. Use the Vapi Web SDK on the client side.
{
"assistantId": "assistant-id"
}
Client-side (JavaScript):
import Vapi from "@vapi-ai/web";
const vapi = new Vapi("your-public-key");
vapi.start("your-assistant-id");
Define an assistant inline instead of referencing a saved one:
{
"assistant": {
"name": "Quick Test",
"firstMessage": "Hello! This is a test call.",
"model": {
"provider": "openai",
"model": "gpt-4.1",
"messages": [
{
"role": "system",
"content": "You are a test assistant. Confirm the call is working and end politely."
}
]
},
"voice": { "provider": "vapi", "voiceId": "Elliot" },
"transcriber": { "provider": "deepgram", "model": "nova-3", "language": "en" }
},
"phoneNumberId": "phone-number-id",
"customer": {
"number": "+11234567890"
}
}
Schedule a call for a future time:
{
"assistantId": "assistant-id",
"phoneNumberId": "phone-number-id",
"customer": {
"number": "+11234567890"
},
"schedulePlan": {
"earliestAt": "2025-06-15T14:00:00Z",
"latestAt": "2025-06-15T15:00:00Z"
}
}
earliestAt — Earliest time to attempt the call (ISO 8601)latestAt — Latest time to attempt the call (optional)assistantId, the latest version of the assistant is used at call timeassistant (transient) insteadCall multiple numbers in one request:
{
"assistantId": "assistant-id",
"phoneNumberId": "phone-number-id",
"customers": [
{ "number": "+11234567890", "name": "Alice" },
{ "number": "+10987654321", "name": "Bob" },
{ "number": "+15551234567", "name": "Carol" }
]
}
Combine with schedulePlan for scheduled batch calls.
Pass custom data accessible during the call:
{
"assistantId": "assistant-id",
"phoneNumberId": "phone-number-id",
"customer": {
"number": "+11234567890"
},
"metadata": {
"orderId": "ORD-12345",
"department": "billing"
}
}
# List calls
curl "https://api.vapi.ai/call?limit=10" \
-H "Authorization: Bearer $VAPI_API_KEY"
# Get a specific call
curl https://api.vapi.ai/call/{id} \
-H "Authorization: Bearer $VAPI_API_KEY"
# Get call with transcript and recording
curl https://api.vapi.ai/call/{id} \
-H "Authorization: Bearer $VAPI_API_KEY"
# Response includes: transcript, recordingUrl, summary, costBreakdown
# Delete a call
curl -X DELETE https://api.vapi.ai/call/{id} \
-H "Authorization: Bearer $VAPI_API_KEY"
A successful call creation returns:
{
"id": "call-uuid",
"orgId": "org-uuid",
"type": "outboundPhoneCall",
"status": "queued",
"assistantId": "assistant-id",
"phoneNumberId": "phone-number-id",
"customer": {
"number": "+11234567890"
},
"createdAt": "2025-01-15T10:00:00Z"
}
Call statuses: queued → ringing → in-progress → ended
It is a violation of FCC law to dial phone numbers without consent in an automated manner. Review TCPA consent requirements before launching automated call campaigns.
This skills repository includes a Vapi documentation MCP server (vapi-docs) that gives your AI agent access to the full Vapi knowledge base. Use the searchDocs tool to look up anything beyond what this skill covers — advanced configuration, troubleshooting, SDK details, and more.
Auto-configured: If you cloned or installed these skills, the MCP server is already configured via .mcp.json (Claude Code), .cursor/mcp.json (Cursor), or .vscode/mcp.json (VS Code Copilot).
Manual setup: If your agent doesn't auto-detect the config, run:
claude mcp add vapi-docs -- npx -y mcp-remote https://docs.vapi.ai/_mcp/server
See the README for full setup instructions across all supported agents.
Weekly Installs
291
Repository
GitHub Stars
22
First Seen
Feb 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
cursor259
kimi-cli255
gemini-cli255
github-copilot255
amp255
codex255
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
56,200 周安装