Vapi Integration for TestMu AI Agent Testing
The Vapi integration connects a Vapi assistant to a Phone Caller agent in the TestMu AI Agent Testing Platform. TestMu AI imports the assistant's prompt and tool catalog, and after every test call it checks which tools the assistant actually called. A transcript shows what the assistant said. The integration shows what it did behind the call.
Without the integration, TestMu AI still tests any Vapi assistant that answers a phone number, with transcripts, recordings, grading, and call quality metrics. Connect it when you also want the prompt imported and the tool calls checked.
Integration at a Glance
| Item | Details |
|---|---|
| Agent type | Phone Caller, inbound. TestMu AI calls your assistant's phone number. |
| Where you connect | The agent's Integrations tab, on the VAPI card. |
| What you need | A Vapi API key and the assistant's ID. |
| What is imported | The assistant's prompt and tool catalog. |
| What is checked | Whether the assistant called each tool a scenario expects, with the arguments and result of every call. |
| Vapi extras | Keep the prompt in sync with the live assistant, and bring production calls into the same analysis view as your test calls. |
Prerequisites
In Vapi
- A published assistant with a phone number it answers on.
- A Vapi API key and the assistant's ID, obtained through your organization's approved credential process.
In TestMu AI
- A Phone Caller agent with the call type Inbound (Bot receives calls), with the assistant's phone number added on its Phone Numbers tab. See Test an Inbound Phone Agent.
API keys are secrets. Enter them only in the integration form, never in a scenario, prompt, test data file, or source code.
Connect Vapi
- Open the Phone Caller agent and select Integrations.
- Select Connect on the VAPI card.
- Fill in the fields, then select Save.
| Field | Required | What to enter |
|---|---|---|
| Vapi Auth API Key | Yes | Your Vapi API key. |
| Vapi Agent ID | Yes | The ID of the assistant you want to test. |
| Vapi Public Key | No | Your Vapi public key, needed only for WebRTC connections. |
| Auto-sync Prompts | No | Keeps the imported prompt in sync with the live assistant between manual syncs. |
| Auto-fetch Production Calls | No | Brings the assistant's production calls into the same analysis view as your test calls. |
The connection works when the card shows Connected and a Re-sync button. TestMu AI stores the credentials as HyperExecute secrets, scoped to this agent. One provider can be connected per agent, so use a separate TestMu AI agent to test another assistant or provider.
Sync the Prompt and Tools
On the Prompt tab, select Sync from Vapi. TestMu AI imports the assistant's prompt and refreshes its tool catalog: the actions the assistant can take, such as booking an appointment or transferring to a human. Generate your scenarios from the imported prompt.
Sync again after you change the assistant in Vapi, so the prompt and tools match what is deployed. With Auto-sync Prompts on, the prompt also stays in sync between manual syncs.
Select the Expected Tools for Each Scenario
Open a scenario and, in the scenario editor, select each tool from the synced catalog that the scenario expects the assistant to call.
| Example scenario | Expected tools |
|---|---|
| Booking | check_availability, book_appointment |
| Cancellation | cancel_appointment |
- Select only the tools the scenario must check. The tool check passes only if the assistant called all of them.
- Scenarios with no tools selected still run, without a tool check.
- If the catalog changes in Vapi, sync again. The scenario editor warns you when a selected tool no longer exists.
Run a Test and Read the Tool Calls
Start with one short scenario and one expected tool in a small suite, to confirm that the right assistant answers and the tool check works. Then run your suites as for any inbound phone agent.
Open a call and select the Tool Calls tab.
| Section | What it shows |
|---|---|
| Expected Tool Validation | Each tool selected on the scenario, marked Called or Not Called. |
| Selected AUT Tool Calls | Each call the assistant made to a selected tool, with its status, arguments, and result. |
| AUT Tool Calls | Every tool the assistant called, including tools you didn't select, so unexpected calls are visible. |
- Read the transcript and the tool calls together. If the assistant says it booked or transferred while the tool shows Not Called, it claimed an action it didn't take.
- A tool that ran but returned an error still shows Called, so check the result of each call.
- Not Called can be the right outcome, for example when the caller never gave the assistant the details it needed.
Troubleshooting
| Problem | What to do |
|---|---|
| The API key is rejected | Create or copy a valid key in Vapi, then save it again. |
| The assistant isn't found | Check that the agent ID is a Vapi assistant ID, copied in full. |
| The wrong assistant answers | Check the saved agent ID and the number on the Phone Numbers tab, then run the short test again. |
| No tools appear in the scenario editor | Confirm the assistant has tools in Vapi, then select Re-sync. |
| The scenario editor warns that selected tools no longer match | The catalog changed in Vapi. Sync again and review the scenario's tools. |
| A call shows no expected tools mapped | The scenario has no tools selected, so only the call itself was graded. Select its expected tools. |
| A key may have been exposed | Rotate it in Vapi and save the new key. |
Security and Credentials
- Saved credentials are stored as HyperExecute secrets, scoped to the agent where you save them.
- TestMu AI uses them only to read the assistant's configuration, check its activity during your test calls, and, with Auto-fetch Production Calls on, fetch its production calls. It never modifies your assistant.
- Use separate keys for test and production, rotate them on your usual schedule, and disconnect the integration when you no longer need it.
Testing Tips for Vapi Assistants
- Default tools. Give each default tool its own scenario:
transferCall,endCall,dtmf,sms, andapiRequest. - Squad handoffs. Squads hand off mid-call, so test the transfer boundary between assistants.
- Other surfaces. The integration works on phone calls. To test the same assistant without a phone line, connect it as a voice agent over WebSocket, where audio pauses can trigger silence timeouts, or as a chat agent through Vapi's Chat API, where session IDs carry context between turns.
Other Integrations
- Phone Caller agents: Amazon Connect, Cartesia, ElevenLabs, Retell, and Salesforce Agentforce.
- Voice agents: Deepgram Voice Agent.
- See Phone Agent Testing for everything else a phone test covers.