> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rubrichq.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rubrichq.io/_mcp/server.

# Vapi

Test an existing **Vapi assistant** with no code. RubricHQ connects to your Vapi account, starts a web call to your assistant, and runs your scenario against it — and can also **pull the assistant's config** and **auto-import production calls** for observability.

This is an **external-provider** agent: the bot lives in Vapi, and RubricHQ reaches it over Vapi's own transport.

---

## 1. Connect Vapi (once per workspace)

**Settings → Integrations → Vapi** → paste your API key. It's stored encrypted and reused by every agent on Vapi.

You can also connect inline from the agent screen when you pick the provider.

---

## 2. Configure the agent

On the agent's **Configuration** tab, choose **Agent Type → Vapi** and set the **Assistant ID** (e.g. `asst_xxxx…`). The ID field unlocks once Vapi is connected for the workspace.

---

## 3. Instructions: Sync from vendor **or** Paste

Two mutually-exclusive options (buttons appear once the provider + Assistant ID are set):

### Sync instructions from vendor

Pulls the latest config straight from Vapi and fills the agent:

```json
{
  "instructions":  "<the assistant's system prompt>",
  "first_message": { "type": "assistant-waits-for-user", "message": "" },
  "language":      "en-US",
  "phone_number":  "+15722238368"
}
```

* **Instructions** — the system prompt, used to generate scenarios and suggest prompt improvements.
* **Opening prompt** — derived from how your assistant starts (speaks first vs waits), so our caller adapts.
* **Primary language** — matched to a supported language (locale-tolerant, e.g. `en` ↔ `en-US`).
* **Phone number** — resolved from the linked Vapi phone number when present.

### Paste instructions

Define the **opening prompt** and **instructions** yourself (just like a self-managed agent), and set primary language + phone number directly. Choosing this **disables instruction auto-sync** so Vapi never overwrites what you typed.

---

## 4. Auto-sync (optional)

Two independent toggles under the agent's external-provider settings:

| Toggle                | What it does                                                                                                                                            |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Sync instructions** | Re-pulls the Vapi assistant config on a fixed 24h cadence (disabled when you're pasting instructions).                                                  |
| **Fetch calls**       | Imports the assistant's **production calls** into RubricHQ observability on your chosen interval, with a configurable **minimum call duration** filter. |

Imported calls get the full observability treatment — transcript, recording, and standard metrics — alongside your test runs.

---

## 5. How a test run works

When you run a scenario/batch against a Vapi assistant:

1. RubricHQ starts a **web call** to your assistant through the Vapi API.
2. Our AI caller runs your scenario; we auto-detect whether your assistant speaks first and adapt the opening.
3. The call is recorded; **transcript metrics** and (where audio is available) **audio metrics** are computed.

No endpoints to implement on your side — Vapi hosts the bot, RubricHQ drives the caller.

---

## Results

Each run shows the **transcript**, **recording**, **call metadata** (end reason, cost, vendor summary, success/sentiment, structured data when present), and **metrics**. Auto-fetched production calls appear in **Observability → Conversations** for the agent.

> **Tip**
>
> Use **Vapi** when the assistant already lives in Vapi. For Retell agents see [Retell](/integrations/retell); to run your own bot in a LiveKit or Daily room (e.g. Pipecat) see [LiveKit](/integrations/livekit) or [Daily](/integrations/daily).