> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getusertrace.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Vapi Integration

> Test voice agents built with the Vapi platform

Test your Vapi-powered voice agents by connecting them to UserTrace. Our simulated users will interact with your Vapi assistants through realistic voice conversations.

## Getting Started

### 1. Connect Your Vapi Assistant

In the UserTrace dashboard, navigate to **Agent Setup** and select **Vapi Integration**.

**Required Information:**

* Vapi Assistant ID
* Vapi API Token

**Example:**

```
Vapi Assistant ID: 01234567-89ab-cdef-0123-456789abcdef
```

### 2. Set Evaluation Context

Define your pass and fail criteria for voice interactions:

**Example Pass/Fail Criteria:**

```
Pass Criteria:
- Responds within 3 seconds of user input
- Uses clear, natural speech patterns
- Correctly understands user intent
- Provides accurate information
- Maintains conversational flow

Fail Criteria:
- Response time exceeds 10 seconds
- Speech is unclear or robotic
- Misunderstands simple requests
- Provides incorrect information
- Abruptly ends conversations
```

## Testing Process

### Inbound Agent Testing

For Vapi assistants that answer incoming calls:

1. Our test number calls your Vapi assistant
2. Vapi processes the conversation according to your assistant configuration
3. The conversation continues based on the scenario
4. Results are analyzed and scored

### Outbound Agent Testing

For Vapi assistants that make outgoing calls:

1. UserTrace triggers your Vapi assistant to initiate a call
2. Your assistant calls our designated test number (5-minute window)
3. Our simulated user responds according to the scenario
4. The conversation continues until completion
5. Results are analyzed and scored

**Key Requirements:**

* **Call our number when simulation starts** (5-minute window)
* **Use the exact Vapi assistant** you configured in setup
* **Ensure your assistant is active** and properly configured

## Vapi-Specific Features

### Assistant Configuration

**Voice Settings:**

* Leverage Vapi's voice synthesis options
* Configure speech speed and tone
* Set up custom pronunciation rules

**Function Calling:**

* Test your custom functions through voice commands
* Verify function parameters are correctly extracted
* Ensure proper error handling for failed functions

**Knowledge Base Integration:**

* Test retrieval of information from your knowledge base
* Verify accurate responses to domain-specific questions
* Check handling of out-of-scope queries

### Advanced Features

**Interruption Handling:**

* Test how your assistant handles user interruptions
* Verify smooth conversation flow resumption
* Check for appropriate acknowledgment of interruptions

**Transfer and Escalation:**

* Test handoff scenarios to human agents
* Verify proper context preservation during transfers
* Check escalation triggers work correctly

## Best Practices

<CardGroup cols={2}>
  <Card title="Voice Quality" icon="microphone">
    **Optimize Speech**

    • Use Vapi's voice tuning features
    • Test different voice models
    • Optimize for your use case
    • Monitor speech clarity scores
  </Card>

  <Card title="Response Timing" icon="clock">
    **Timing Requirements**

    • Target \< 3 seconds response time
    • Handle processing delays gracefully
    • Use Vapi's streaming features
    • Implement proper timeout handling
  </Card>
</CardGroup>

## Common Scenarios

**Customer Support:**

* Technical troubleshooting calls
* Account assistance requests
* Product information inquiries
* Complaint resolution

**Sales & Lead Qualification:**

* Initial prospect screening
* Product demonstrations
* Quote discussions
* Follow-up conversations

**Appointment Scheduling:**

* Booking confirmations
* Rescheduling requests
* Reminder calls
* Cancellation handling

## Troubleshooting

**Common Issues:**

**Vapi Connection:**

* **Assistant not responding**: Verify Vapi assistant is active and published
* **Poor audio quality**: Check Vapi voice model settings
* **Function calls failing**: Validate function schemas and endpoints
* **Knowledge base errors**: Verify knowledge base is properly indexed

**Call Flow:**

* **Calls not connecting**: Ensure phone number is correctly configured in Vapi
* **Unexpected disconnections**: Check Vapi's call duration limits
* **Transfer failures**: Verify transfer phone numbers and settings

<Note>
  **Need help with Vapi setup?** Check the [Vapi documentation](https://docs.vapi.ai) or contact [support@getusertrace.com](mailto:support@getusertrace.com).
</Note>
