create-assistant

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Vapi Assistant Creation

创建Vapi语音AI助手

Create fully configured voice AI assistants using the Vapi API. Assistants combine a language model, voice, and transcriber to handle real-time phone and web conversations.
Setup: Ensure
VAPI_API_KEY
is set. See the
setup-api-key
skill if needed.
使用Vapi API创建配置完整的语音AI助手。助手结合语言模型、语音与转录器,可处理实时电话及网络对话。
设置说明: 请确保已配置
VAPI_API_KEY
。若需要,可参考
setup-api-key
技能。

Quick Start

快速开始

cURL

cURL

bash
curl -X POST https://api.vapi.ai/assistant \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Support Assistant",
    "firstMessage": "Hello! How can I help you today?",
    "model": {
      "provider": "openai",
      "model": "gpt-4.1",
      "messages": [
        {
          "role": "system",
          "content": "You are a friendly phone support assistant. Keep responses concise and under 30 words."
        }
      ]
    },
    "voice": {
      "provider": "vapi",
      "voiceId": "Elliot"
    },
    "transcriber": {
      "provider": "deepgram",
      "model": "nova-3",
      "language": "en"
    }
  }'
bash
curl -X POST https://api.vapi.ai/assistant \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Support Assistant",
    "firstMessage": "Hello! How can I help you today?",
    "model": {
      "provider": "openai",
      "model": "gpt-4.1",
      "messages": [
        {
          "role": "system",
          "content": "You are a friendly phone support assistant. Keep responses concise and under 30 words."
        }
      ]
    },
    "voice": {
      "provider": "vapi",
      "voiceId": "Elliot"
    },
    "transcriber": {
      "provider": "deepgram",
      "model": "nova-3",
      "language": "en"
    }
  }'

TypeScript (Server SDK)

TypeScript(服务端SDK)

typescript
import { VapiClient } from "@vapi-ai/server-sdk";

const vapi = new VapiClient({ token: process.env.VAPI_API_KEY! });

const assistant = await vapi.assistants.create({
  name: "Support Assistant",
  firstMessage: "Hello! How can I help you today?",
  model: {
    provider: "openai",
    model: "gpt-4.1",
    messages: [
      {
        role: "system",
        content: "You are a friendly phone support assistant. Keep responses concise and under 30 words.",
      },
    ],
  },
  voice: {
    provider: "vapi",
    voiceId: "Elliot",
  },
  transcriber: {
    provider: "deepgram",
    model: "nova-3",
    language: "en",
  },
});

console.log("Assistant created:", assistant.id);
typescript
import { VapiClient } from "@vapi-ai/server-sdk";

const vapi = new VapiClient({ token: process.env.VAPI_API_KEY! });

const assistant = await vapi.assistants.create({
  name: "Support Assistant",
  firstMessage: "Hello! How can I help you today?",
  model: {
    provider: "openai",
    model: "gpt-4.1",
    messages: [
      {
        role: "system",
        content: "You are a friendly phone support assistant. Keep responses concise and under 30 words.",
      },
    ],
  },
  voice: {
    provider: "vapi",
    voiceId: "Elliot",
  },
  transcriber: {
    provider: "deepgram",
    model: "nova-3",
    language: "en",
  },
});

console.log("Assistant created:", assistant.id);

Python

Python

python
import requests
import os

response = requests.post(
    "https://api.vapi.ai/assistant",
    headers={
        "Authorization": f"Bearer {os.environ['VAPI_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "name": "Support Assistant",
        "firstMessage": "Hello! How can I help you today?",
        "model": {
            "provider": "openai",
            "model": "gpt-4.1",
            "messages": [
                {
                    "role": "system",
                    "content": "You are a friendly phone support assistant. Keep responses concise and under 30 words.",
                }
            ],
        },
        "voice": {"provider": "vapi", "voiceId": "Elliot"},
        "transcriber": {"provider": "deepgram", "model": "nova-3", "language": "en"},
    },
)

assistant = response.json()
print(f"Assistant created: {assistant['id']}")
python
import requests
import os

response = requests.post(
    "https://api.vapi.ai/assistant",
    headers={
        "Authorization": f"Bearer {os.environ['VAPI_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "name": "Support Assistant",
        "firstMessage": "Hello! How can I help you today?",
        "model": {
            "provider": "openai",
            "model": "gpt-4.1",
            "messages": [
                {
                    "role": "system",
                    "content": "You are a friendly phone support assistant. Keep responses concise and under 30 words.",
                }
            ],
        },
        "voice": {"provider": "vapi", "voiceId": "Elliot"},
        "transcriber": {"provider": "deepgram", "model": "nova-3", "language": "en"},
    },
)

assistant = response.json()
print(f"Assistant created: {assistant['id']}")

Core Configuration

核心配置

Model (required)

模型(必填)

The language model powering the assistant's intelligence.
ProviderModelsNotes
openai
gpt-4o
,
gpt-4o-mini
,
gpt-4-turbo
Most popular, best tool calling
anthropic
claude-3-5-sonnet-20241022
,
claude-3-5-haiku-20241022
Strong reasoning
google
gemini-1.5-pro
,
gemini-1.5-flash
Multimodal capable
groq
llama-3.1-70b-versatile
,
llama-3.1-8b-instant
Ultra-fast inference
deepinfra
meta-llama/Meta-Llama-3.1-70B-Instruct
Open-source models
openrouter
VariousAccess 100+ models
perplexity
llama-3.1-sonar-large-128k-online
Web-connected
together-ai
Various open-sourceCost-effective
json
{
  "model": {
    "provider": "openai",
    "model": "gpt-4.1",
    "temperature": 0.7,
    "maxTokens": 1000,
    "messages": [
      {
        "role": "system",
        "content": "Your system prompt here. Define the assistant's personality, rules, and behavior."
      }
    ]
  }
}
为助手提供智能能力的语言模型。
服务商模型说明
openai
gpt-4o
,
gpt-4o-mini
,
gpt-4-turbo
最受欢迎,工具调用能力最优
anthropic
claude-3-5-sonnet-20241022
,
claude-3-5-haiku-20241022
推理能力强劲
google
gemini-1.5-pro
,
gemini-1.5-flash
支持多模态
groq
llama-3.1-70b-versatile
,
llama-3.1-8b-instant
推理速度极快
deepinfra
meta-llama/Meta-Llama-3.1-70B-Instruct
开源模型
openrouter
多种模型可访问100+种模型
perplexity
llama-3.1-sonar-large-128k-online
支持联网
together-ai
多种开源模型性价比高
json
{
  "model": {
    "provider": "openai",
    "model": "gpt-4.1",
    "temperature": 0.7,
    "maxTokens": 1000,
    "messages": [
      {
        "role": "system",
        "content": "此处填写系统提示词。定义助手的性格、规则及行为方式。"
      }
    ]
  }
}

Voice

语音

The text-to-speech voice for the assistant.
ProviderPopular VoicesNotes
vapi
Elliot
,
Lily
,
Rohan
,
Paola
,
Kian
Vapi's optimized voices, lowest latency
11labs
Use voice IDs from ElevenLabsHigh quality, many voices
playht
Use voice IDs from PlayHTExpressive voices
cartesia
Use voice IDs from CartesiaFast, high quality
openai
alloy
,
echo
,
fable
,
onyx
,
nova
,
shimmer
OpenAI TTS voices
azure
Azure voice namesEnterprise-grade
deepgram
aura-asteria-en
,
aura-luna-en
Low latency
rime-ai
Use voice IDs from RimeSpecialized voices
json
{
  "voice": {
    "provider": "vapi",
    "voiceId": "Elliot"
  }
}
助手使用的文本转语音语音包。
服务商热门语音说明
vapi
Elliot
,
Lily
,
Rohan
,
Paola
,
Kian
Vapi优化语音,延迟最低
11labs
使用ElevenLabs提供的语音ID音质高,可选语音多
playht
使用PlayHT提供的语音ID表现力丰富
cartesia
使用Cartesia提供的语音ID速度快、音质高
openai
alloy
,
echo
,
fable
,
onyx
,
nova
,
shimmer
OpenAI官方TTS语音
azure
Azure官方语音名称企业级服务
deepgram
aura-asteria-en
,
aura-luna-en
延迟低
rime-ai
使用Rime提供的语音ID特色语音
json
{
  "voice": {
    "provider": "vapi",
    "voiceId": "Elliot"
  }
}

Transcriber

转录器

The speech-to-text engine for understanding callers.
ProviderModelsNotes
deepgram
nova-3
,
nova-2
Fastest, most accurate
google
latest_long
,
latest_short
Google Cloud STT
gladia
fast
,
accurate
European provider
assembly-ai
best
,
nano
High accuracy
speechmatics
VariousEnterprise STT
talkscriber
DefaultSpecialized
json
{
  "transcriber": {
    "provider": "deepgram",
    "model": "nova-3",
    "language": "en",
    "keywords": ["Vapi:2", "AI:1"]
  }
}
The
keywords
field boosts recognition of specific words (word:boost format, boost 1-10).
用于理解通话者的语音转文本引擎。
服务商模型说明
deepgram
nova-3
,
nova-2
速度最快,准确率最高
google
latest_long
,
latest_short
Google云语音转文本服务
gladia
fast
,
accurate
欧洲服务商
assembly-ai
best
,
nano
准确率高
speechmatics
多种模型企业级语音转文本服务
talkscriber
默认模型专业领域优化
json
{
  "transcriber": {
    "provider": "deepgram",
    "model": "nova-3",
    "language": "en",
    "keywords": ["Vapi:2", "AI:1"]
  }
}
keywords
字段可提升特定词汇的识别率(格式为“词汇:权重”,权重范围1-10)。

Behavior Configuration

行为配置

First Message

初始消息

json
{
  "firstMessage": "Hello! Thanks for calling Acme Corp. How can I help you today?",
  "firstMessageMode": "assistant-speaks-first"
}
firstMessageMode
options:
  • "assistant-speaks-first"
    — Assistant greets immediately (default)
  • "assistant-waits-for-user"
    — Assistant waits for caller to speak first
  • "assistant-speaks-first-with-model-generated-message"
    — LLM generates the greeting
json
{
  "firstMessage": "Hello! Thanks for calling Acme Corp. How can I help you today?",
  "firstMessageMode": "assistant-speaks-first"
}
firstMessageMode
可选值:
  • "assistant-speaks-first"
    — 助手主动发起问候(默认)
  • "assistant-waits-for-user"
    — 助手等待用户先发言
  • "assistant-speaks-first-with-model-generated-message"
    — 由大语言模型生成问候语

Background Sound

背景音效

json
{
  "backgroundSound": "office"
}
Options:
"off"
,
"office"
,
"static"
json
{
  "backgroundSound": "office"
}
可选值:
"off"
,
"office"
,
"static"

Backchanneling

对话回应

Enable natural conversational acknowledgments ("uh-huh", "I see"):
json
{
  "backgroundDenoisingEnabled": true,
  "backchannelingEnabled": true
}
启用自然对话中的确认回应(如“嗯哼”、“我明白”):
json
{
  "backgroundDenoisingEnabled": true,
  "backchannelingEnabled": true
}

HIPAA Compliance

HIPAA合规

json
{
  "hipaaEnabled": true
}
When enabled, Vapi won't store call recordings or transcripts.
json
{
  "hipaaEnabled": true
}
启用后,Vapi不会存储通话录音或转录文本。

Adding Tools

添加工具

Attach tools so the assistant can take actions during calls.
为助手附加工具,使其可在通话中执行操作。

Using saved tool IDs

使用已保存的工具ID

json
{
  "model": {
    "provider": "openai",
    "model": "gpt-4.1",
    "toolIds": ["tool-id-1", "tool-id-2"],
    "messages": [{"role": "system", "content": "..."}]
  }
}
json
{
  "model": {
    "provider": "openai",
    "model": "gpt-4.1",
    "toolIds": ["tool-id-1", "tool-id-2"],
    "messages": [{"role": "system", "content": "..."}]
  }
}

Inline tool definition

内联定义工具

json
{
  "model": {
    "provider": "openai",
    "model": "gpt-4.1",
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "check_availability",
          "description": "Check appointment availability for a given date",
          "parameters": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "description": "Date in YYYY-MM-DD format"
              }
            },
            "required": ["date"]
          }
        },
        "server": {
          "url": "https://your-server.com/api/tools"
        }
      }
    ],
    "messages": [{"role": "system", "content": "..."}]
  }
}
json
{
  "model": {
    "provider": "openai",
    "model": "gpt-4.1",
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "check_availability",
          "description": "Check appointment availability for a given date",
          "parameters": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "description": "Date in YYYY-MM-DD format"
              }
            },
            "required": ["date"]
          }
        },
        "server": {
          "url": "https://your-server.com/api/tools"
        }
      }
    ],
    "messages": [{"role": "system", "content": "..."}]
  }
}

Hooks

钩子配置

Automate actions when specific call events occur. See hooks reference for details.
json
{
  "hooks": [
    {
      "on": "customer.speech.timeout",
      "options": {
        "timeoutSeconds": 10,
        "triggerMaxCount": 3
      },
      "do": [
        {
          "type": "say",
          "exact": "Are you still there?"
        }
      ]
    },
    {
      "on": "call.ending",
      "filters": [
        {
          "type": "oneOf",
          "key": "call.endedReason",
          "oneOf": ["pipeline-error"]
        }
      ],
      "do": [
        {
          "type": "tool",
          "tool": {
            "type": "transferCall",
            "destinations": [
              {
                "type": "number",
                "number": "+1234567890"
              }
            ]
          }
        }
      ]
    }
  ]
}
在特定通话事件发生时自动执行操作。详情请参考钩子参考文档
json
{
  "hooks": [
    {
      "on": "customer.speech.timeout",
      "options": {
        "timeoutSeconds": 10,
        "triggerMaxCount": 3
      },
      "do": [
        {
          "type": "say",
          "exact": "Are you still there?"
        }
      ]
    },
    {
      "on": "call.ending",
      "filters": [
        {
          "type": "oneOf",
          "key": "call.endedReason",
          "oneOf": ["pipeline-error"]
        }
      ],
      "do": [
        {
          "type": "tool",
          "tool": {
            "type": "transferCall",
            "destinations": [
              {
                "type": "number",
                "number": "+1234567890"
              }
            ]
          }
        }
      ]
    }
  ]
}

Managing Assistants

助手管理

List

列出所有助手

bash
curl https://api.vapi.ai/assistant \
  -H "Authorization: Bearer $VAPI_API_KEY"
bash
curl https://api.vapi.ai/assistant \
  -H "Authorization: Bearer $VAPI_API_KEY"

Get

获取单个助手详情

bash
curl https://api.vapi.ai/assistant/{id} \
  -H "Authorization: Bearer $VAPI_API_KEY"
bash
curl https://api.vapi.ai/assistant/{id} \
  -H "Authorization: Bearer $VAPI_API_KEY"

Update

更新助手配置

bash
curl -X PATCH https://api.vapi.ai/assistant/{id} \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "firstMessage": "Updated greeting!"
  }'
bash
curl -X PATCH https://api.vapi.ai/assistant/{id} \
  -H "Authorization: Bearer $VAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "firstMessage": "Updated greeting!"
  }'

Delete

删除助手

bash
curl -X DELETE https://api.vapi.ai/assistant/{id} \
  -H "Authorization: Bearer $VAPI_API_KEY"
bash
curl -X DELETE https://api.vapi.ai/assistant/{id} \
  -H "Authorization: Bearer $VAPI_API_KEY"

Common Patterns

常见场景示例

Customer Support Agent

客户支持助手

json
{
  "name": "Customer Support",
  "firstMessage": "Thank you for calling! How can I assist you today?",
  "model": {
    "provider": "openai",
    "model": "gpt-4.1",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful customer support agent for Acme Corp. Be empathetic, concise, and solution-oriented. If you cannot resolve an issue, offer to transfer to a human agent. Keep responses under 30 words."
      }
    ]
  },
  "voice": { "provider": "vapi", "voiceId": "Lily" },
  "transcriber": { "provider": "deepgram", "model": "nova-3", "language": "en" },
  "backchannelingEnabled": true
}
json
{
  "name": "Customer Support",
  "firstMessage": "Thank you for calling! How can I assist you today?",
  "model": {
    "provider": "openai",
    "model": "gpt-4.1",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful customer support agent for Acme Corp. Be empathetic, concise, and solution-oriented. If you cannot resolve an issue, offer to transfer to a human agent. Keep responses under 30 words."
      }
    ]
  },
  "voice": { "provider": "vapi", "voiceId": "Lily" },
  "transcriber": { "provider": "deepgram", "model": "nova-3", "language": "en" },
  "backchannelingEnabled": true
}

Appointment Scheduler

预约调度助手

json
{
  "name": "Appointment Scheduler",
  "firstMessage": "Hi there! I can help you schedule an appointment. What date works best for you?",
  "model": {
    "provider": "openai",
    "model": "gpt-4.1",
    "messages": [
      {
        "role": "system",
        "content": "You are an appointment scheduling assistant. Collect the customer's preferred date, time, and service type. Confirm details before booking. Be friendly and efficient."
      }
    ],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "book_appointment",
          "description": "Book an appointment for the given date, time, and service",
          "parameters": {
            "type": "object",
            "properties": {
              "date": { "type": "string", "description": "YYYY-MM-DD" },
              "time": { "type": "string", "description": "HH:MM in 24h format" },
              "service": { "type": "string", "description": "Type of service" },
              "name": { "type": "string", "description": "Customer name" }
            },
            "required": ["date", "time", "service", "name"]
          }
        },
        "server": { "url": "https://your-server.com/api/book" }
      }
    ]
  },
  "voice": { "provider": "vapi", "voiceId": "Paola" },
  "transcriber": { "provider": "deepgram", "model": "nova-3", "language": "en" }
}
json
{
  "name": "Appointment Scheduler",
  "firstMessage": "Hi there! I can help you schedule an appointment. What date works best for you?",
  "model": {
    "provider": "openai",
    "model": "gpt-4.1",
    "messages": [
      {
        "role": "system",
        "content": "You are an appointment scheduling assistant. Collect the customer's preferred date, time, and service type. Confirm details before booking. Be friendly and efficient."
      }
    ],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "book_appointment",
          "description": "Book an appointment for the given date, time, and service",
          "parameters": {
            "type": "object",
            "properties": {
              "date": { "type": "string", "description": "YYYY-MM-DD" },
              "time": { "type": "string", "description": "HH:MM in 24h format" },
              "service": { "type": "string", "description": "Type of service" },
              "name": { "type": "string", "description": "Customer name" }
            },
            "required": ["date", "time", "service", "name"]
          }
        },
        "server": { "url": "https://your-server.com/api/book" }
      }
    ]
  },
  "voice": { "provider": "vapi", "voiceId": "Paola" },
  "transcriber": { "provider": "deepgram", "model": "nova-3", "language": "en" }
}

Multilingual Agent

多语言助手

json
{
  "name": "Multilingual Support",
  "firstMessage": "Hello! How can I help you? / Hola! Como puedo ayudarte?",
  "model": {
    "provider": "openai",
    "model": "gpt-4.1",
    "messages": [
      {
        "role": "system",
        "content": "You are a multilingual support assistant. Detect the caller's language and respond in the same language. You support English and Spanish."
      }
    ]
  },
  "voice": { "provider": "vapi", "voiceId": "Paola" },
  "transcriber": { "provider": "deepgram", "model": "nova-3", "language": "multi" }
}
json
{
  "name": "Multilingual Support",
  "firstMessage": "Hello! How can I help you? / Hola! Como puedo ayudarte?",
  "model": {
    "provider": "openai",
    "model": "gpt-4.1",
    "messages": [
      {
        "role": "system",
        "content": "You are a multilingual support assistant. Detect the caller's language and respond in the same language. You support English and Spanish."
      }
    ]
  },
  "voice": { "provider": "vapi", "voiceId": "Paola" },
  "transcriber": { "provider": "deepgram", "model": "nova-3", "language": "multi" }
}

References

参考文档

  • Hooks Configuration — Complete hook events and actions
  • Voice & Model Providers — All supported providers and models
  • Vapi API Docs — Official documentation
  • 钩子配置 — 完整的钩子事件与操作说明
  • 语音与模型服务商 — 所有支持的服务商及模型
  • Vapi API官方文档 — 官方文档

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 Agent访问完整的Vapi知识库。使用
searchDocs
工具可查询本技能未覆盖的内容——高级配置、故障排查、SDK细节等。
自动配置: 若你克隆或安装了本技能,MCP服务器已通过
.mcp.json
(Claude Code)、
.cursor/mcp.json
(Cursor)或
.vscode/mcp.json
(VS Code Copilot)完成配置。
手动配置: 若你的Agent未自动检测到配置,请执行:
bash
claude mcp add vapi-docs -- npx -y mcp-remote https://docs.vapi.ai/_mcp/server
请参考README获取全平台Agent的完整设置说明。