create-phone-number

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Vapi Phone Number Setup

Vapi 电话号码设置

Import phone numbers from Twilio, Vonage, or Telnyx, or use Vapi's built-in numbers to connect voice assistants to real phone calls.
Setup: Ensure
VAPI_API_KEY
is set. See the
setup-api-key
skill if needed.
从Twilio、Vonage或Telnyx导入电话号码,或使用Vapi内置号码将语音助手与真实通话连接起来。
设置: 确保已配置
VAPI_API_KEY
。如有需要,请查看
setup-api-key
技能。

Quick Start — Buy a Vapi Number

快速开始 — 购买Vapi号码

Vapi provides free phone numbers for testing with daily call limits.
bash
curl -X POST https://api.vapi.ai/phone-number \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "vapi",
    "assistantId": "your-assistant-id",
    "name": "Main Support Line"
  }'
Vapi提供免费电话号码用于测试,有每日通话限制。
bash
curl -X POST https://api.vapi.ai/phone-number \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "vapi",
    "assistantId": "your-assistant-id",
    "name": "Main Support Line"
  }'

Import from Twilio

从Twilio导入

bash
curl -X POST https://api.vapi.ai/phone-number \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "twilio",
    "number": "+11234567890",
    "twilioAccountSid": "your-twilio-account-sid",
    "twilioAuthToken": "your-twilio-auth-token",
    "assistantId": "your-assistant-id",
    "name": "Twilio Support Line"
  }'
bash
curl -X POST https://api.vapi.ai/phone-number \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "twilio",
    "number": "+11234567890",
    "twilioAccountSid": "your-twilio-account-sid",
    "twilioAuthToken": "your-twilio-auth-token",
    "assistantId": "your-assistant-id",
    "name": "Twilio Support Line"
  }'

Import from Vonage

从Vonage导入

bash
curl -X POST https://api.vapi.ai/phone-number \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "vonage",
    "number": "+11234567890",
    "credentialId": "your-vonage-credential-id",
    "assistantId": "your-assistant-id",
    "name": "Vonage Support Line"
  }'
bash
curl -X POST https://api.vapi.ai/phone-number \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "vonage",
    "number": "+11234567890",
    "credentialId": "your-vonage-credential-id",
    "assistantId": "your-assistant-id",
    "name": "Vonage Support Line"
  }'

Import from Telnyx

从Telnyx导入

bash
curl -X POST https://api.vapi.ai/phone-number \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "telnyx",
    "number": "+11234567890",
    "credentialId": "your-telnyx-credential-id",
    "assistantId": "your-assistant-id",
    "name": "Telnyx Support Line"
  }'
bash
curl -X POST https://api.vapi.ai/phone-number \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "telnyx",
    "number": "+11234567890",
    "credentialId": "your-telnyx-credential-id",
    "assistantId": "your-assistant-id",
    "name": "Telnyx Support Line"
  }'

Assign an Assistant

关联助手

Every phone number can be linked to an assistant or squad for inbound calls:
bash
curl -X PATCH https://api.vapi.ai/phone-number/{id} \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "assistantId": "your-assistant-id"
  }'
Or assign a squad:
bash
curl -X PATCH https://api.vapi.ai/phone-number/{id} \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "squadId": "your-squad-id"
  }'
每个电话号码都可以关联到一个助手或团队,用于处理呼入通话:
bash
curl -X PATCH https://api.vapi.ai/phone-number/{id} \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "assistantId": "your-assistant-id"
  }'
或者关联一个团队:
bash
curl -X PATCH https://api.vapi.ai/phone-number/{id} \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "squadId": "your-squad-id"
  }'

Phone Number Hooks

电话号码钩子

Configure automated actions when calls come in:
json
{
  "hooks": [
    {
      "on": "call.ringing",
      "do": [
        {
          "type": "say",
          "exact": "Please hold while we connect you."
        }
      ]
    }
  ]
}
配置通话接入时的自动化操作:
json
{
  "hooks": [
    {
      "on": "call.ringing",
      "do": [
        {
          "type": "say",
          "exact": "Please hold while we connect you."
        }
      ]
    }
  ]
}

Managing Phone Numbers

管理电话号码

bash
undefined
bash
undefined

List all phone numbers

列出所有电话号码

curl https://api.vapi.ai/phone-number
-H "Authorization: Bearer $VAPI_API_KEY"
curl https://api.vapi.ai/phone-number
-H "Authorization: Bearer $VAPI_API_KEY"

Get a phone number

获取单个电话号码信息

curl https://api.vapi.ai/phone-number/{id}
-H "Authorization: Bearer $VAPI_API_KEY"
curl https://api.vapi.ai/phone-number/{id}
-H "Authorization: Bearer $VAPI_API_KEY"

Update a phone number

更新电话号码信息

curl -X PATCH https://api.vapi.ai/phone-number/{id}
-H "Authorization: Bearer $VAPI_API_KEY"
-H "Content-Type: application/json"
-d '{"name": "Updated Name"}'
curl -X PATCH https://api.vapi.ai/phone-number/{id}
-H "Authorization: Bearer $VAPI_API_KEY"
-H "Content-Type: application/json"
-d '{"name": "Updated Name"}'

Delete a phone number

删除电话号码

curl -X DELETE https://api.vapi.ai/phone-number/{id}
-H "Authorization: Bearer $VAPI_API_KEY"
undefined
curl -X DELETE https://api.vapi.ai/phone-number/{id}
-H "Authorization: Bearer $VAPI_API_KEY"
undefined

Inbound Call Flow

呼入通话流程

  1. Caller dials your Vapi phone number
  2. Vapi routes the call to the assigned assistant or squad
  3. The assistant speaks its
    firstMessage
  4. The conversation proceeds with the configured model, voice, and tools
  1. 呼叫者拨打你的Vapi电话号码
  2. Vapi将通话路由到关联的助手或团队
  3. 助手说出其
    firstMessage
    内容
  4. 对话按照配置的模型、语音和工具进行

Outbound Call Flow

呼出通话流程

  1. Create a call via
    POST /call
    with
    phoneNumberId
    and
    customer.number
  2. Vapi dials the customer from your phone number
  3. When answered, the assistant begins the conversation
  1. 通过
    POST /call
    接口创建通话,传入
    phoneNumberId
    customer.number
  2. Vapi使用你的电话号码拨打客户
  3. 客户接听后,助手开始对话

Free Number Limitations

免费号码限制

  • Cannot make international calls
  • Daily call limits apply
  • For production use, import your own Twilio/Vonage/Telnyx numbers
  • 无法拨打国际电话
  • 有每日通话次数限制
  • 生产环境请导入自己的Twilio/Vonage/Telnyx号码

References

参考资料

Additional Resources

额外资源

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:
bash
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.
本技能仓库包含一个Vapi文档MCP服务器
vapi-docs
),可为你的AI助手提供完整的Vapi知识库访问权限。使用
searchDocs
工具查找本技能未涵盖的内容——高级配置、故障排除、SDK细节等。
自动配置: 如果你克隆或安装了这些技能,MCP服务器已通过
.mcp.json
(Claude Code)、
.cursor/mcp.json
(Cursor)或
.vscode/mcp.json
(VS Code Copilot)完成配置。
手动配置: 如果你的助手未自动检测到配置,请运行:
bash
claude mcp add vapi-docs -- npx -y mcp-remote https://docs.vapi.ai/_mcp/server
查看README获取所有支持助手的完整设置说明。