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

# Testing

> This guide will walk you through the process of setting up and testing voice agents using VAPI integration in Cekura. When creating a new agent, you can select VAPI as your provider from the available options in the agent creation interface.

export const CopyPageButton = () => {
  if (typeof window !== 'undefined') {
    setTimeout(function () {
      if (document.getElementById('ck-tools')) return;
      var anchor = document.getElementById('content-area') || document.querySelector('.mdx-content');
      if (!anchor) return;
      if (!document.getElementById('ck-style')) {
        var s = document.createElement('style');
        s.id = 'ck-style';
        s.textContent = '#ck-tools{position:absolute;top:6px;right:0;z-index:100;font-family:inherit;}' + '.ck-row{display:inline-flex;align-items:stretch;border:1px solid rgba(0,0,0,0.15);border-radius:8px;overflow:hidden;background:#fff;}' + ':root.dark .ck-row{background:rgba(255,255,255,0.06);border-color:rgba(255,255,255,0.12);}' + '.ck-btn{padding:5px 12px;border:none;background:none;cursor:pointer;font-size:13px;font-weight:500;font-family:inherit;color:#374151;}' + ':root.dark .ck-btn{color:#d1d5db;}' + '.ck-btn:hover{background:rgba(0,0,0,0.04);}' + ':root.dark .ck-btn:hover{background:rgba(255,255,255,0.06);}' + '.ck-chevron{padding:5px 8px;border:none;background:none;cursor:pointer;font-size:14px;font-family:inherit;color:#374151;}' + ':root.dark .ck-chevron{color:#d1d5db;}' + '.ck-chevron:hover{background:rgba(0,0,0,0.04);}' + ':root.dark .ck-chevron:hover{background:rgba(255,255,255,0.06);}' + '.ck-divider{width:1px;background:rgba(0,0,0,0.12);flex-shrink:0;}' + ':root.dark .ck-divider{background:rgba(255,255,255,0.12);}' + '.ck-dd{position:absolute;top:calc(100% + 4px);right:0;min-width:180px;background:#fff;border:1px solid rgba(0,0,0,0.12);border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,0.1);padding:4px;display:none;z-index:200;}' + ':root.dark .ck-dd{background:#1f2937;border-color:rgba(255,255,255,0.1);box-shadow:0 4px 16px rgba(0,0,0,0.35);}' + '.ck-item{display:block;width:100%;padding:7px 12px;border:none;background:none;border-radius:6px;cursor:pointer;font-size:13px;font-family:inherit;text-align:left;color:#374151;}' + ':root.dark .ck-item{color:#d1d5db;}' + '.ck-item:hover{background:rgba(0,0,0,0.05);}' + ':root.dark .ck-item:hover{background:rgba(255,255,255,0.07);}';
        document.head.appendChild(s);
      }
      var wrap = document.createElement('div');
      wrap.id = 'ck-tools';
      var row = document.createElement('div');
      row.className = 'ck-row';
      var mainBtn = document.createElement('button');
      mainBtn.className = 'ck-btn';
      mainBtn.textContent = 'Copy page';
      var divider = document.createElement('span');
      divider.className = 'ck-divider';
      var chevron = document.createElement('button');
      chevron.className = 'ck-chevron';
      chevron.textContent = '▾';
      var dd = document.createElement('div');
      dd.className = 'ck-dd';
      function closeDD() {
        dd.style.display = 'none';
      }
      function openDD() {
        dd.style.display = 'block';
      }
      chevron.onclick = function (e) {
        e.stopPropagation();
        if (dd.style.display === 'block') {
          closeDD();
        } else {
          openDD();
        }
      };
      document.addEventListener('click', function (e) {
        if (!e.target.closest('#ck-tools')) {
          closeDD();
        }
      });
      document.addEventListener('keydown', function (e) {
        if (e.key === 'Escape') {
          closeDD();
        }
      });
      function makeItem(label, fn) {
        var b = document.createElement('button');
        b.className = 'ck-item';
        b.textContent = label;
        b.onclick = function () {
          fn();
          closeDD();
        };
        return b;
      }
      function getMarkdown() {
        var walk = function (node) {
          if (!node) return '';
          if (node.nodeType === 3) return node.textContent || '';
          if (node.nodeType !== 1) return '';
          var tag = node.tagName.toLowerCase();
          var skip = ['script', 'style', 'svg', 'noscript', 'button', 'iframe'];
          if (skip.indexOf(tag) !== -1) return '';
          if (node.id === 'ck-tools') return '';
          var ch = Array.from(node.childNodes).map(walk).join('');
          if (tag === 'h1') return '\n# ' + ch.trim() + '\n\n';
          if (tag === 'h2') return '\n## ' + ch.trim() + '\n\n';
          if (tag === 'h3') return '\n### ' + ch.trim() + '\n\n';
          if (tag === 'p') return '\n' + ch.trim() + '\n\n';
          if (tag === 'pre') return '\n```\n' + node.textContent.trim() + '\n```\n\n';
          if (tag === 'li') return '- ' + ch.trim() + '\n';
          if (tag === 'code') return '`' + ch.trim() + '`';
          return ch;
        };
        var content = document.querySelector('.mdx-content') || document.getElementById('content-area') || document.body;
        return walk(content).replace(/\n\n\n+/g, '\n\n').trim();
      }
      function copyMd() {
        var md = getMarkdown();
        navigator.clipboard.writeText(md).then(function () {
          mainBtn.textContent = 'Copied!';
          setTimeout(function () {
            mainBtn.textContent = 'Copy page';
          }, 2000);
        });
      }
      function viewMd() {
        var md = getMarkdown();
        var safe = md.split('&').join('&amp;').split('<').join('&lt;').split('>').join('&gt;');
        var html = '<!DOCTYPE html><html><head><meta charset="utf-8"><style>body{font-family:monospace;max-width:860px;margin:40px auto;padding:0 24px;line-height:1.7;white-space:pre-wrap;word-wrap:break-word}</style></head><body>' + safe + '</body></html>';
        window.open(URL.createObjectURL(new Blob([html], {
          type: 'text/html'
        })), '_blank');
      }
      function openClaude() {
        var prompt = 'Can you read this Cekura docs page ' + window.location.href + ' so I can ask you questions?';
        window.open('https://claude.ai/new?q=' + encodeURIComponent(prompt), '_blank');
      }
      mainBtn.onclick = copyMd;
      dd.appendChild(makeItem('Copy page', copyMd));
      dd.appendChild(makeItem('View as Markdown', viewMd));
      dd.appendChild(makeItem('Open in Claude', openClaude));
      row.appendChild(mainBtn);
      row.appendChild(divider);
      row.appendChild(chevron);
      wrap.appendChild(row);
      wrap.appendChild(dd);
      anchor.style.position = 'relative';
      anchor.insertBefore(wrap, anchor.firstChild);
    }, 50);
  }
  return null;
};

<CopyPageButton />

## Video Tutorial

Watch this video to see the VAPI integration in action:

<iframe width="100%" height="450" src="https://www.youtube.com/embed/z1RGhQ9CUTE" title="Test Vapi Agents in Cekura | Vapi x Cekura" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />

<Note>
  You can test your agents directly on our platform without configuring API
  keys. Cekura will use internally generated transcripts for testing purposes.
  For a simpler setup without API keys, check out our guide on [testing custom
  agents](/documentation/guides/testing-agents/overview).
</Note>

## Prerequisites

To successfully integrate your VAPI agent, you will need the following:

* A **Cekura account**
* A **VAPI account** with a deployed Voice Assistant.
* Your **VAPI Private API Key** (for Cekura's Organization or Project Settings).
* Your VAPI **Assistant ID** (for the Cekura Agent configuration).

## Testing with VAPI

This guide walks you through setting up and testing your Voice AI agents built on the **VAPI** platform using Cekura.

By linking your VAPI Assistant to Cekura, you can run automated test suites, analyze call performance, and ensure agent quality.

<Tabs>
  <Tab title="Voice">
    Test your VAPI voice agents with automated call simulation.

    <Steps>
      <Step title="Create a New Agent">
        1. Navigate to the **Agents** section from the left navigation bar.
        2. Click the **Create Agent** button in the top right, or click **Create your first agent** if you're new.
        3. Fill in the **Agent name**, **Language**, and **Description of your AI Agent**, then click **Next**.

                   <img src="https://mintcdn.com/vocera/TwfRd5EQeiW9Y10g/images/create-agent.png?fit=max&auto=format&n=TwfRd5EQeiW9Y10g&q=85&s=483db3b8f42198d7f5f13796fba0d1cd" alt="Create an Agent" width="1262" height="913" data-path="images/create-agent.png" />
      </Step>

      <Step title="Configure Agent Settings">
        1. In the **Provider** panel on the right, select **VAPI**.
        2. Under **Integration Settings**, enter the **External Assistant ID** of your VAPI agent.
        3. Enter your VAPI **Private API Key** in the designated field.
        4. Click **Save Changes**.

                   <img src="https://mintcdn.com/vocera/jgU_15-26qRVL6Rl/images/vapi/agent-settings.png?fit=max&auto=format&n=jgU_15-26qRVL6Rl&q=85&s=4f7d709f640a47f3db13b1da487e16e5" alt="VAPI Agent Settings" width="1285" height="861" data-path="images/vapi/agent-settings.png" />

        > **Note:** The VAPI Assistant ID is required to link a specific agent, and the VAPI Private API Key is required for Cekura to authenticate and communicate with VAPI.
      </Step>

      <Step title="Run Your First Test">
        Once your VAPI Agent is configured:

        1. Go to **Simulation → Evaluator**.
        2. Click **Generate Evaluators** to auto-create some scenarios (or create one).

           You can also use the [Infrastructure Suite](/documentation/guides/testing-agents/infrastructure-suite) to instantly add 18+ pre-built test cases covering latency, audio quality, and interruption handling.
        3. Choose a **Scenario** from the list.
        4. Click the **Play button (▶︎)** next to it to open the **Configure Run** dialog. Under **Connections**, select **Telephony** and enter your phone number.

                   <img src="https://mintcdn.com/vocera/jgU_15-26qRVL6Rl/images/vapi/configure-run-voice.png?fit=max&auto=format&n=jgU_15-26qRVL6Rl&q=85&s=c33909342618a764f806a3e3f70801b1" alt="Configure Run dialog with VAPI voice connection selected" width="542" height="722" data-path="images/vapi/configure-run-voice.png" />

           > **Note:** Greyed out connections are not configured, set them up in your [Agent Setting's **Provider**](/documentation/key-concepts/agents/Agent_Setup_Guide#chat-connection) panel if you want to run with SIP.
      </Step>

      <Step title="Monitor Your Test">
        1. Monitor the test in **Simulation → Runs Overview**.
        2. View **transcripts, audio, and metrics** in **Results**.
        3. Use **Re-run Failed** or **Lab → Optimize** to refine and rerun.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Chat">
    Test your VAPI chat agents through text-based interactions.

    <Steps>
      <Step title="Connect VAPI to Cekura">
        Link your VAPI agent to the Cekura platform:

        1. Navigate to the **Agents** section and open the agent you want to configure.
        2. In the **Provider** panel on the right, select **VAPI**.
        3. Under **Integration Settings**, enter the **External Assistant ID** of your VAPI agent.
        4. Enter your VAPI **Private API Key** in the designated field.
        5. Click **Save Changes**.

                   <img src="https://mintcdn.com/vocera/jgU_15-26qRVL6Rl/images/vapi/agent-settings.png?fit=max&auto=format&n=jgU_15-26qRVL6Rl&q=85&s=4f7d709f640a47f3db13b1da487e16e5" alt="VAPI Agent Settings" width="1285" height="861" data-path="images/vapi/agent-settings.png" />

           > **Note:** VAPI Chat is configured automatically using your voice agent settings — no separate chat agent setup is required.
      </Step>

      <Step title="Run Chat Tests">
        Execute your tests to ensure results appear on the dashboard:

        1. Navigate to **Evaluator**.

        2. Click **Generate Evaluators** or **Create Evaluators** (Skip this step if you already have evaluators created).

           You can also use the [Infrastructure Suite](/documentation/guides/testing-agents/infrastructure-suite) to instantly add 18+ pre-built test cases covering latency, audio quality, and interruption handling.

        3. Choose an **Evaluator** from the list.

        4. Click **Run** to open the **Configure Run** dialog. Under **Connections**, select **VAPI** under the **CHAT** section.

                   <img src="https://mintcdn.com/vocera/jgU_15-26qRVL6Rl/images/vapi/configure-run-chat.png?fit=max&auto=format&n=jgU_15-26qRVL6Rl&q=85&s=99fe4bfd2b3bb88ab651e709768a278b" alt="Configure Run dialog with VAPI chat connection selected" width="548" height="618" data-path="images/vapi/configure-run-chat.png" />

           > **Note:** Greyed out connections are not configured, set them up in your [Agent Setting's **Provider**](/documentation/key-concepts/agents/Agent_Setup_Guide#chat-connection) panel if you want to run with SMS or WhatsApp.

        5. Monitor the test in **Results** section.

           > **Tip:** Chat testing is ideal for rapid iteration on conversation design before deploying to voice.
      </Step>
    </Steps>

    ### Helpful Tips

    * **Run Workflow Testing:** Even if you are building voice agents on VAPI, running them in text mode is much faster and cheaper. You will be able to effectively test the workflow of your agent with this approach.
    * **No Phone Number needed:** With chat testing, you do not need to configure any phone number on VAPI.
    * **Test Profile variables work in chat mode:** Any variables defined in a [Test Profile's](/documentation/key-concepts/evaluators/test-profile) `main_agent_variables` section are forwarded to your VAPI agent in chat mode the same way they are in voice and WebRTC runs. This makes chat mode a cost-effective way to validate variable-driven prompt logic before running the more expensive voice tests.
  </Tab>

  <Tab title="WebRTC">
    Test your VAPI voice agents through direct WebRTC connections — no phone number required. Faster and cheaper than phone-based testing, ideal for rapid iteration.

    <Steps>
      <Step title="Configure Agent Settings">
        1. Navigate to the **Agents** section and open the agent you want to configure.
        2. In the **Provider** panel on the right, select **VAPI**.
        3. Under **Integration Settings**, enter the **External Assistant ID** of your VAPI agent.
        4. Enter your VAPI **Private API Key** in the designated field.
        5. In the **Connections** section, expand **WebRTC Settings** and enter your VAPI **Public Key**. This is required for WebRTC testing.
        6. Click **Save Changes**.

                   <img src="https://mintcdn.com/vocera/jgU_15-26qRVL6Rl/images/vapi/agent-settings.png?fit=max&auto=format&n=jgU_15-26qRVL6Rl&q=85&s=4f7d709f640a47f3db13b1da487e16e5" alt="VAPI Agent Settings" width="1285" height="861" data-path="images/vapi/agent-settings.png" />

           > **Note:** You can also configure your VAPI Private API Key globally in **Settings → Provider API Keys** to use it across all VAPI agents. The Public Key is only needed for WebRTC testing and is configured per-agent in the WebRTC Settings section.
      </Step>

      <Step title="Run WebRTC Tests">
        Once your VAPI Agent is configured:

        1. Go to **Simulation → Evaluator**.
        2. Click **Generate Evaluators** to auto-create basic metrics, or select existing evaluators.
        3. Choose an **Evaluator** from the list.
        4. Click the **Play button (▶︎)** next to it to open the **Configure Run** dialog. Under **Connections**, select **WebRTC** and enter your **VAPI Assistant ID**, then click **Run**.

                   <img src="https://mintcdn.com/vocera/jgU_15-26qRVL6Rl/images/vapi/configure-run-webrtc.png?fit=max&auto=format&n=jgU_15-26qRVL6Rl&q=85&s=ce9255d02817fe7804a47cc7b2231902" alt="Configure Run dialog with VAPI WebRTC connection selected" width="548" height="703" data-path="images/vapi/configure-run-webrtc.png" />
      </Step>

      <Step title="Monitor Results">
        1. Navigate to **Simulation → Runs Overview** to monitor test progress.
        2. View **transcripts, audio, and metrics** in **Results**.
        3. Use **Re-run Failed** or **Lab → Optimize** to refine and rerun.
      </Step>
    </Steps>

    <Tip>
      WebRTC tests skip phone infrastructure entirely — no phone number needed, no telephony costs, and tests start immediately.
    </Tip>

    <Tip>
      **Passing variables to your Vapi agent in WebRTC runs:** Any values defined in a [Test Profile's](/documentation/key-concepts/evaluators/test-profile#profile-sections-main-agent-vs-testing-agent) `main_agent_variables` section are forwarded to your Vapi agent as `assistantOverrides.variableValues` in WebRTC runs — the same way they work in voice runs. To pass specific values (for example, from a form or CRM) into your agent's `{{var}}` system-prompt placeholders, create a Test Profile with those values in `main_agent_variables` and attach it to the evaluator.
    </Tip>
  </Tab>
</Tabs>

## Value of VAPI Integration

Integrating your VAPI Assistant with Cekura unlocks powerful testing and observability features:

* **Detailed Tool Call Information:** You are able to see granular data on **tool calls** made by your VAPI agent during a conversation, which is critical for debugging complex workflows.
* **Metadata Access:** You are also able to access **any metadata** available from VAPI calls, enabling richer, context-aware evaluations of agent performance.
* **Automated Outbound Calling:** You can use Cekura's infrastructure for **automated outbound calling** to run large-scale, performance-driven test campaigns.

  <img src="https://mintcdn.com/vocera/jgU_15-26qRVL6Rl/images/outbound-calling.png?fit=max&auto=format&n=jgU_15-26qRVL6Rl&q=85&s=5cad122fac532d3f2ee848d1d1c13e55" alt="Outbound Calling" width="1329" height="898" data-path="images/outbound-calling.png" />

<Accordion title="Setting Up VAPI Integration (Across Agents)">
  This setup is recommended as it configures your VAPI API Key once, making it available **across all agents within your project**. If you complete this step, you will *not* need to enter the API Key when creating subsequent VAPI agents.

  1. Log in to your [Cekura Dashboard](https://dashboard.cekura.ai).
  2. Click on the **Settings** button (usually on the top right of the navigation bar).
  3. Navigate to the **Provider API Keys** tab.
  4. Locate the VAPI section.
  5. Enter your VAPI **Private API Key** in the designated field.
  6. Click **Save Changes**.

       <img src="https://mintcdn.com/vocera/6B_S8Iy-VRRSNDHs/images/vapi_providerapi.png?fit=max&auto=format&n=6B_S8Iy-VRRSNDHs&q=85&s=7eedc7258aa9f4cad8a7f8f0683a438f" alt="Vapi Providerapi Pn" width="1636" height="857" data-path="images/vapi_providerapi.png" />
</Accordion>

## Mock Tools (optional)

If your VAPI agent calls tools, you can test it without hitting live services using [Mock Tools](/documentation/key-concepts/evaluators/mock-tools). Use **Auto-Fetch** to pull your VAPI tools and generate mock data, then enable the **Mock** toggle — Cekura creates cloned tools pointing at its mock endpoints (your original tools are preserved) and restores them when you disable the toggle.

VAPI's end-of-call report already includes the tool calls your agent made, and Cekura extracts those into the transcript automatically. So the [Mock Tool Call Accuracy](/documentation/key-concepts/evaluators/mock-tools#verifying-tool-calls-the-mock-tool-call-accuracy-metric) metric works out of the box — unlike a [custom integration](/documentation/integrations/custom-integration#mock-tools-optional), you don't assemble or send the transcript yourself.

## Next Steps

* Learn about [custom metrics](/documentation/key-concepts/metrics/custom-metrics)
* Explore [predefined metrics](/documentation/key-concepts/metrics/pre-defined-metrics)
* Set up [instruction following metric](/documentation/key-concepts/metrics/instruction-following-metric)
