Vapi
Vapi is a voice AI platform for building conversational agents. Preclinical connects to Vapi via their Chat API to test your assistants with text-based conversations.
Configuration
| Field | Required | Description |
|---|---|---|
api_key |
Yes | Vapi API key |
assistant_id |
Yes | Target assistant ID |
api_base |
No | Override API base URL (default: https://api.vapi.ai) |
Alternative field names: provider_id or providerId can be used instead of assistant_id. All fields also accept camelCase (apiKey, assistantId).
Setup
- Go to Vapi Dashboard > Settings > API Keys and copy your API key
- Go to Assistants, select your assistant, and copy the Assistant ID
- In Preclinical, create a new agent:
{
"name": "My Vapi Assistant",
"provider": "vapi",
"config": {
"api_key": "your-vapi-api-key",
"assistant_id": "asst_xxxxx"
}
}
How It Works
- Preclinical sends a message via Vapi's Chat API (
POST https://api.vapi.ai/chat) - Your assistant processes the message and responds
- Process repeats for configured number of turns (conversation continuity via
chatId) - Final transcript is graded
Common Errors
| Error | Cause | Resolution |
|---|---|---|
| 401 Unauthorized | Invalid API key | Check api_key in config |
| 404 Not Found | Invalid assistant ID | Verify assistant_id exists |
| 429 Rate Limit | Too many requests | Automatic retry with backoff |
| 500 Server Error | Vapi internal error | Automatic retry |
Troubleshooting
Empty responses -- Verify assistant responds to messages. Check assistant's prompt configuration. Test assistant manually in Vapi playground.
Authentication errors -- Verify API key is correct and active. Check key has required permissions.