> ## 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.

# ElevenLabs

> Test agents with automated ElevenLabs connection

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 />

<iframe src="https://www.youtube.com/embed/o7ZqAGMuYQY" title="YouTube video player" frameborder="0" className="w-full aspect-video rounded-xl" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen />

## Overview

Test your ElevenLabs agents using multiple methods: phone numbers, websockets, or chat interfaces. Choose the testing method that best fits your use case.

<Tabs>
  <Tab title="Phone Number">
    Test your agents using phone numbers directly from the frontend.

    <Steps>
      <Step title="Configure phone number">
        Go to your agent settings and configure the phone number for testing:

        <img src="https://mintcdn.com/vocera/BVNDKbLg0hX4qjr9/images/elevenlabs/phone-config.png?fit=max&auto=format&n=BVNDKbLg0hX4qjr9&q=85&s=7fc0ef7dd7441d63c0c0a812eecc36d4" alt="ElevenLabs Phone Number Configuration" width="834" height="376" data-path="images/elevenlabs/phone-config.png" />

        <Note>
          Enter the phone number associated with your ElevenLabs agent. No additional credentials required for phone-based testing.
        </Note>
      </Step>

      <Step title="Run tests from frontend">
        Select scenarios and run tests using the UI. This will open the **Configure Run** dialog.

        In the **Configure Run** dialog, select **Telephony** under Voice connections and click **Run**.

        <img src="https://mintcdn.com/vocera/TwfRd5EQeiW9Y10g/images/elevenlabs/run-websocket-tests.png?fit=max&auto=format&n=TwfRd5EQeiW9Y10g&q=85&s=2e2136c6a57d79389268259fc69e3340" alt="Run ElevenLabs Phone Tests" width="548" height="721" data-path="images/elevenlabs/run-websocket-tests.png" />

        Cekura automatically:

        * Initiates phone calls to your agent
        * Executes test scenarios
        * Captures audio and transcript data

        <Note>You can override the phone number directly in this dialog before running.\
        \
        Connection options that appear greyed out have not been configured in Agent Settings yet — set them up there to enable them.</Note>
      </Step>

      <Step title="View results">
        Results appear in your dashboard. Track test status, metrics, and conversation details in real-time.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Websocket">
    Run tests directly from the frontend without writing code.

    <Steps>
      <Step title="Configure ElevenLabs credentials">
        Go to your agent settings and configure ElevenLabs integration:

        <img src="https://mintcdn.com/vocera/TwfRd5EQeiW9Y10g/images/elevenlabs/agent-settings.png?fit=max&auto=format&n=TwfRd5EQeiW9Y10g&q=85&s=137691791557d09190dd54835cd2f55c" alt="ElevenLabs Agent Settings" width="1371" height="912" data-path="images/elevenlabs/agent-settings.png" />

        **Required fields:**

        * **Assistant ID**: Your ElevenLabs agent ID
        * **ElevenLabs API Key**: Your ElevenLabs API key with access to Agents

        <Note>
          To find your Assistant ID, go to your ElevenLabs dashboard and navigate to the Agents section. Go to your particular agent you want to test, open that agent and assistant id (11labs agent id) will be visible just below the header.
        </Note>
      </Step>

      <Step title="Run tests from frontend">
        Select scenarios and run tests using the UI. This will open the **Configure Run** dialog.

        In the **Configure Run** dialog, select **Websocket** under Voice connections and click **Run**.

        <img src="https://mintcdn.com/vocera/TwfRd5EQeiW9Y10g/images/elevenlabs/run-tests-websocket.png?fit=max&auto=format&n=TwfRd5EQeiW9Y10g&q=85&s=044fa618227c3c60d539f8a6de77c73a" alt="Run ElevenLabs Websocket Tests" width="535" height="696" data-path="images/elevenlabs/run-tests-websocket.png" />

        Cekura automatically:

        * Connects to your ElevenLabs agent via websocket
        * Executes test scenarios
        * Captures audio and transcript data

        <Note>You can override the Base URL (websocket endpoint) directly in this dialog before running.\
        \
        Connection options that appear greyed out have not been configured in Agent Settings yet — set them up there to enable them.</Note>
      </Step>

      <Step title="View results">
        Results appear in your dashboard. Track test status, metrics, and conversation details in real-time.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Chat">
    Test your agents using chat interface directly from the frontend.

    <Steps>
      <Step title="Configure chat provider and assistant id">
        1. Navigate to the **Agents** section and open the agent you want to configure.
        2. In the **Provider** panel on the right, select **ElevenLabs**.
        3. Enter the Assistant ID of your ElevenLabs agent in the **External Assistant ID** field.
        4. Enter your ElevenLabs API Key in the **ElevenLabs API Key** field.
        5. Click **Save Changes** to configure the agent.

        <img src="https://mintcdn.com/vocera/TwfRd5EQeiW9Y10g/images/elevenlabs/agent-settings.png?fit=max&auto=format&n=TwfRd5EQeiW9Y10g&q=85&s=137691791557d09190dd54835cd2f55c" alt="ElevenLabs Agent Settings" width="1371" height="912" data-path="images/elevenlabs/agent-settings.png" />

        <Note>
          Select ElevenLabs chat provider from the available options in the agent settings.
        </Note>

        <Note>
          To find your Assistant ID, go to your ElevenLabs dashboard and navigate to the Agents section. Open your agent and the assistant ID will be visible just below the header.
        </Note>
      </Step>

      <Step title="Run tests from frontend">
        Select scenarios and run tests using the UI. This will open the **Configure Run** dialog.

        In the **Configure Run** dialog, select **ElevenLabs** under chat connections, and click **Run**.

        <img src="https://mintcdn.com/vocera/TwfRd5EQeiW9Y10g/images/elevenlabs/run-tests-chat.png?fit=max&auto=format&n=TwfRd5EQeiW9Y10g&q=85&s=3c6ac388c7065af039964431d5be622f" alt="Run ElevenLabs Chat Tests" width="538" height="620" data-path="images/elevenlabs/run-tests-chat.png" />

        Cekura automatically:

        * Connects to your ElevenLabs agent via the selected chat interface
        * Executes test scenarios
        * Captures conversation transcripts

        <Note>You can override the phone number for SMS/WhatsApp directly in this dialog before running.\
        \
        Connection options that appear greyed out have not been configured in Agent Settings yet — set them up there to enable them.</Note>
      </Step>

      <Step title="View results">
        Results appear in your dashboard. Track test status, metrics, and conversation details in real-time.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Code">
    Use the API to integrate ElevenLabs testing into your workflow.

    ## Prerequisites

    Configure ElevenLabs credentials in your agent settings:

    <img src="https://mintcdn.com/vocera/TwfRd5EQeiW9Y10g/images/elevenlabs/agent-settings.png?fit=max&auto=format&n=TwfRd5EQeiW9Y10g&q=85&s=137691791557d09190dd54835cd2f55c" alt="ElevenLabs Agent Settings" width="1371" height="912" data-path="images/elevenlabs/agent-settings.png" />

    **Required fields:**

    * **Assistant ID**: Your ElevenLabs agent ID
    * **ElevenLabs API Key**: Your ElevenLabs API key with access to Agents

    <Note>
      To find your Assistant ID, go to your ElevenLabs dashboard and navigate to the Agents section. Go to your particular agent you want to test, open that agent and assistant id (11labs agent id) will be visible just below the header.
    </Note>

    ## API Endpoint

    ```
    POST https://api.cekura.ai/test_framework/v1/scenarios-external/run_scenarios_elevenlabs/
    ```

    ## Authentication

    Include your API key in the request header:

    ```
    X-CEKURA-API-KEY: <YOUR_API_KEY>
    ```

    ## Request Parameters

    **scenarios** (array | integer | string, required): Test scenarios to run

    * **Array format**: List of scenario IDs `[123, 456, 789]`
    * **Integer format**: Run first N scenarios for the agent `5`
    * **String format**: Run all scenarios for the agent `"all"`

    **agent\_id** (integer, optional): Your Agent ID in Cekura. Required when using integer or "all" format for scenarios

    **frequency** (integer, optional): Number of times to run each scenario (default: 1)

    **name** (string, optional): Custom name for this test run

    **conversation\_config\_override** (object, optional): Override conversation configuration for this run

    ## Examples

    ### Single Run (cURL)

    ```bash theme={null}
    curl -X POST \
      'https://api.cekura.ai/test_framework/v1/scenarios-external/run_scenarios_elevenlabs/' \
      -H 'X-CEKURA-API-KEY: <YOUR_API_KEY>' \
      -H 'Content-Type: application/json' \
      -d '{
        "scenarios": [30]
      }'
    ```

    ### Multiple Runs (cURL)

    ```bash theme={null}
    curl -X POST \
      'https://api.cekura.ai/test_framework/v1/scenarios-external/run_scenarios_elevenlabs/' \
      -H 'X-CEKURA-API-KEY: <YOUR_API_KEY>' \
      -H 'Content-Type: application/json' \
      -d '{
        "scenarios": [30, 31, 32],
        "frequency": 2,
        "name": "ElevenLabs Test Run"
      }'
    ```

    ### Run First N Scenarios (cURL)

    ```bash theme={null}
    curl -X POST \
      'https://api.cekura.ai/test_framework/v1/scenarios-external/run_scenarios_elevenlabs/' \
      -H 'X-CEKURA-API-KEY: <YOUR_API_KEY>' \
      -H 'Content-Type: application/json' \
      -d '{
        "scenarios": 5,
        "agent_id": 123,
        "frequency": 1,
        "name": "First 5 Scenarios"
      }'
    ```

    ### Run All Scenarios (cURL)

    ```bash theme={null}
    curl -X POST \
      'https://api.cekura.ai/test_framework/v1/scenarios-external/run_scenarios_elevenlabs/' \
      -H 'X-CEKURA-API-KEY: <YOUR_API_KEY>' \
      -H 'Content-Type: application/json' \
      -d '{
        "scenarios": "all",
        "agent_id": 123,
        "frequency": 1,
        "name": "All Scenarios Test"
      }'
    ```

    ### With Custom Configuration (cURL)

    ```bash theme={null}
    curl -X POST \
      'https://api.cekura.ai/test_framework/v1/scenarios-external/run_scenarios_elevenlabs/' \
      -H 'X-CEKURA-API-KEY: <YOUR_API_KEY>' \
      -H 'Content-Type: application/json' \
      -d '{
        "scenarios": [30],
        "conversation_config_override": {
          "tts": {
            "voice_id": "custom_voice_id"
          }
        },
        "frequency": 1,
        "name": "Custom Config Test"
      }'
    ```

    ### Python Example

    ```python theme={null}
    import requests

    API_KEY = "<YOUR_API_KEY>"
    BASE_URL = "https://api.cekura.ai/test_framework"

    headers = {
        "X-CEKURA-API-KEY": API_KEY,
        "Content-Type": "application/json",
    }

    payload = {
        "scenarios": [30, 31, 32],
        "frequency": 2,
        "name": "ElevenLabs Test Run"
    }

    resp = requests.post(
        f"{BASE_URL}/v1/scenarios-external/run_scenarios_elevenlabs/",
        headers=headers,
        json=payload,
    )
    result = resp.json()
    print(result)
    ```

    ### Python with Configuration Override

    ```python theme={null}
    import requests

    API_KEY = "<YOUR_API_KEY>"
    BASE_URL = "https://api.cekura.ai/test_framework"

    headers = {
        "X-CEKURA-API-KEY": API_KEY,
        "Content-Type": "application/json",
    }

    payload = {
        "scenarios": [30],
        "conversation_config_override": {
            "tts": {
                "voice_id": "custom_voice_id"
            }
        },
        "frequency": 1,
        "name": "Custom Config Test"
    }

    resp = requests.post(
        f"{BASE_URL}/v1/scenarios-external/run_scenarios_elevenlabs/",
        headers=headers,
        json=payload,
    )
    result = resp.json()
    print(result)
    ```

    ### Python - Run All Scenarios

    ```python theme={null}
    import requests

    API_KEY = "<YOUR_API_KEY>"
    BASE_URL = "https://api.cekura.ai/test_framework"

    headers = {
        "X-CEKURA-API-KEY": API_KEY,
        "Content-Type": "application/json",
    }

    payload = {
        "scenarios": "all",
        "agent_id": 123,
        "frequency": 1,
        "name": "All Scenarios Test"
    }

    resp = requests.post(
        f"{BASE_URL}/v1/scenarios-external/run_scenarios_elevenlabs/",
        headers=headers,
        json=payload,
    )
    result = resp.json()
    print(result)
    ```

    ## Response

    ```json theme={null}
    {
      "id": 16870,
      "name": "ElevenLabs Test Run",
      "agent": 5,
      "status": "in_progress",
      "success_rate": 0.0,
      "run_as_text": false,
      "is_cronjob": false,
      "runs": [
        {
          "id": 34625,
          "status": "running",
          "scenario": 11547,
          "scenario_name": "Customer Support Scenario",
          "test_profile_data": {"key": "value"}
        }
      ],
      "created_at": "2025-10-16T09:32:59.484534Z",
      "updated_at": "2025-10-16T09:32:59.484942Z"
    }
    ```

    ## Error Responses

    ### Missing ElevenLabs Credentials

    ```json theme={null}
    {
      "elevenlabs_creds": ["Please add ElevenLabs credentials"]
    }
    ```

    ### Missing ElevenLabs Agent ID

    ```json theme={null}
    {
      "assistant_id": ["ElevenLabs agent ID (assistant_id) is required but not set on the agent."]
    }
    ```

    ### Invalid Scenarios

    ```json theme={null}
    {
      "scenarios": ["Invalid scenario IDs or scenarios not found"]
    }
    ```

    ### Insufficient Balance

    ```json theme={null}
    {
      "detail": "Insufficient balance for this operation"
    }
    ```

    ## Monitor Results

    Poll for results using the [List Runs with IDs API](/api-reference/test_framework/list-runs-with-ids).
  </Tab>
</Tabs>

## Mock Tools (optional)

If your ElevenLabs 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 ElevenLabs tools and generate mock data, then enable the **Mock** toggle — Cekura updates the webhook tool URLs directly in your agent configuration and restores the originals when you disable the toggle.

ElevenLabs' conversation data 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

* [Custom metrics](/documentation/key-concepts/metrics/custom-metrics)
* [Instruction following metric](/documentation/key-concepts/metrics/instruction-following-metric)
* [Load testing](/documentation/guides/testing-agents/load-testing)
