Loading...
Loading...
Compare original and translation side by side
Setup: Ensureis set. See theVAPI_API_KEYskill if needed.setup-api-key
设置说明: 请确保已配置。若需要,可参考VAPI_API_KEY技能。setup-api-key
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"
}
}'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"
}
}'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);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);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']}")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']}")| Provider | Models | Notes |
|---|---|---|
| | Most popular, best tool calling |
| | Strong reasoning |
| | Multimodal capable |
| | Ultra-fast inference |
| | Open-source models |
| Various | Access 100+ models |
| | Web-connected |
| Various open-source | Cost-effective |
{
"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."
}
]
}
}| 服务商 | 模型 | 说明 |
|---|---|---|
| | 最受欢迎,工具调用能力最优 |
| | 推理能力强劲 |
| | 支持多模态 |
| | 推理速度极快 |
| | 开源模型 |
| 多种模型 | 可访问100+种模型 |
| | 支持联网 |
| 多种开源模型 | 性价比高 |
{
"model": {
"provider": "openai",
"model": "gpt-4.1",
"temperature": 0.7,
"maxTokens": 1000,
"messages": [
{
"role": "system",
"content": "此处填写系统提示词。定义助手的性格、规则及行为方式。"
}
]
}
}| Provider | Popular Voices | Notes |
|---|---|---|
| | Vapi's optimized voices, lowest latency |
| Use voice IDs from ElevenLabs | High quality, many voices |
| Use voice IDs from PlayHT | Expressive voices |
| Use voice IDs from Cartesia | Fast, high quality |
| | OpenAI TTS voices |
| Azure voice names | Enterprise-grade |
| | Low latency |
| Use voice IDs from Rime | Specialized voices |
{
"voice": {
"provider": "vapi",
"voiceId": "Elliot"
}
}| 服务商 | 热门语音 | 说明 |
|---|---|---|
| | Vapi优化语音,延迟最低 |
| 使用ElevenLabs提供的语音ID | 音质高,可选语音多 |
| 使用PlayHT提供的语音ID | 表现力丰富 |
| 使用Cartesia提供的语音ID | 速度快、音质高 |
| | OpenAI官方TTS语音 |
| Azure官方语音名称 | 企业级服务 |
| | 延迟低 |
| 使用Rime提供的语音ID | 特色语音 |
{
"voice": {
"provider": "vapi",
"voiceId": "Elliot"
}
}| Provider | Models | Notes |
|---|---|---|
| | Fastest, most accurate |
| | Google Cloud STT |
| | European provider |
| | High accuracy |
| Various | Enterprise STT |
| Default | Specialized |
{
"transcriber": {
"provider": "deepgram",
"model": "nova-3",
"language": "en",
"keywords": ["Vapi:2", "AI:1"]
}
}keywords| 服务商 | 模型 | 说明 |
|---|---|---|
| | 速度最快,准确率最高 |
| | Google云语音转文本服务 |
| | 欧洲服务商 |
| | 准确率高 |
| 多种模型 | 企业级语音转文本服务 |
| 默认模型 | 专业领域优化 |
{
"transcriber": {
"provider": "deepgram",
"model": "nova-3",
"language": "en",
"keywords": ["Vapi:2", "AI:1"]
}
}keywords{
"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"{
"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"{
"backgroundSound": "office"
}"off""office""static"{
"backgroundSound": "office"
}"off""office""static"{
"backgroundDenoisingEnabled": true,
"backchannelingEnabled": true
}{
"backgroundDenoisingEnabled": true,
"backchannelingEnabled": true
}{
"hipaaEnabled": true
}{
"hipaaEnabled": true
}{
"model": {
"provider": "openai",
"model": "gpt-4.1",
"toolIds": ["tool-id-1", "tool-id-2"],
"messages": [{"role": "system", "content": "..."}]
}
}{
"model": {
"provider": "openai",
"model": "gpt-4.1",
"toolIds": ["tool-id-1", "tool-id-2"],
"messages": [{"role": "system", "content": "..."}]
}
}{
"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": "..."}]
}
}{
"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": [
{
"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"
}
]
}
}
]
}
]
}{
"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"
}
]
}
}
]
}
]
}curl https://api.vapi.ai/assistant \
-H "Authorization: Bearer $VAPI_API_KEY"curl https://api.vapi.ai/assistant \
-H "Authorization: Bearer $VAPI_API_KEY"curl https://api.vapi.ai/assistant/{id} \
-H "Authorization: Bearer $VAPI_API_KEY"curl https://api.vapi.ai/assistant/{id} \
-H "Authorization: Bearer $VAPI_API_KEY"curl -X PATCH https://api.vapi.ai/assistant/{id} \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"firstMessage": "Updated greeting!"
}'curl -X PATCH https://api.vapi.ai/assistant/{id} \
-H "Authorization: Bearer $VAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"firstMessage": "Updated greeting!"
}'curl -X DELETE https://api.vapi.ai/assistant/{id} \
-H "Authorization: Bearer $VAPI_API_KEY"curl -X DELETE https://api.vapi.ai/assistant/{id} \
-H "Authorization: Bearer $VAPI_API_KEY"{
"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
}{
"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
}{
"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" }
}{
"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" }
}{
"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" }
}{
"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" }
}vapi-docssearchDocs.mcp.json.cursor/mcp.json.vscode/mcp.jsonclaude mcp add vapi-docs -- npx -y mcp-remote https://docs.vapi.ai/_mcp/servervapi-docssearchDocs.mcp.json.cursor/mcp.json.vscode/mcp.jsonclaude mcp add vapi-docs -- npx -y mcp-remote https://docs.vapi.ai/_mcp/server