Jax
05/04/2025, 7:40 PMJax
05/04/2025, 7:40 PMVapi Support Bot
05/04/2025, 7:41 PMbash
# 1. Create Assistant
curl -X POST https://api.vapi.ai/assistant \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Assistant",
"firstMessage": "Hello, how can I help?",
"model": {
"provider": "openai",
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "Your system prompt here"
}
]
}
}'
After creating the assistant, you can attach a KB and initiate calls using similar API endpoints.
Sources:
- [Creating an Assistant via API](https://docs.vapi.ai/api-reference/assistants/create-assistant)
- [Creating a KB in Vapi](https://docs.vapi.ai/knowledge-base)
- [Initiating a call with a Vapi Assistant](https://docs.vapi.ai/documentation/advanced-concepts/customization/custom-transcriber)Vapi Support Bot
05/04/2025, 7:42 PMhttps://api.vapi.ai/assistant with your auth token in the header. Here's a sample JSON payload:
json
{
"name": "My Assistant",
"model": {
"provider": "openai",
"model": "gpt-4o",
"systemPrompt": "You're a helpful assistant"
},
"voice": {
"provider": "azure",
"voiceId": "emma"
},
"firstMessage": "Hi, how can I help you today?"
}
Sources:
- [API Reference Create Assistant](https://docs.vapi.ai/api-reference/assistants/create-assistant)
- [Customization Custom Keywords](https://docs.vapi.ai/customization/custom-keywords)Jax
05/04/2025, 7:48 PMVapi Support Bot
05/04/2025, 7:50 PMbash
curl -X POST https://api.vapi.ai/assistant \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Website Assistant",
"model": {
"provider": "openai",
"model": "gpt-4o",
"systemPrompt": "YOUR_GENERATED_SYSTEM_PROMPT"
},
"transcriber": {
"provider": "deepgram",
"model": "nova-2",
"language": "en"
},
"recordingEnabled": true,
"firstMessage": "Hello, I'm your website assistant."
}'
After creating the assistant, you'll need to attach a phone number and KB separately.
Sources:
- [Creating an assistant via API](https://docs.vapi.ai/api-reference/assistants/create-assistant)
- [Configuring transcription settings](https://discord.com/channels/1211482211119796234/1331035264751112202)Jax
05/04/2025, 7:51 PMVapi Support Bot
05/04/2025, 7:52 PMPOST /phone-number endpoint:
bash
curl --location 'https://api.vapi.ai/phone-number' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"provider": "vapi",
"sipUri": "sip:username@sip.vapi.ai",
"assistantId": "YOUR_ASSISTANT_ID"
}'
Replace YOUR_ASSISTANT_ID with the ID of your created assistant.
Sources:
- [Vapi API Documentation](https://docs.vapi.ai/advanced/sip)
- [Vapi API Reference](https://docs.vapi.ai/api-reference/phone-numbers/create)Jax
05/04/2025, 9:36 PMVapi Support Bot
05/04/2025, 9:38 PMbash
curl -X PATCH https://api.vapi.ai/assistant/YOUR_ASSISTANT_ID \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": {
"provider": "openai",
"model": "gpt-4o",
"knowledgeBaseId": "YOUR_KNOWLEDGE_BASE_ID"
}
}'
Make sure to include all previously used properties in the model object (like system prompt) to avoid overwriting them.
Sources:
- [Knowledge Base Documentation](https://docs.vapi.ai/knowledge-base)
- [Discord Channel Discussion](https://discord.com/channels/1211482211119796234/1333975440003563604)Kings_big💫
05/05/2025, 6:52 AMJax
05/05/2025, 10:48 AMKings_big💫
05/05/2025, 11:05 AM