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

# Calls

> Observe production calls and run metrics on real traffic

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

<Note>
  Setup steps and authentication are in the [Overview](/cli-sdk/overview). This page covers production-call observability.
</Note>

A **call** is a production conversation — captured from your live voice agent. Once a call is in Cekura, you can run metrics on it, build test sets from it, and analyze trends across thousands of calls. Webhooks from Vapi / Retell / ElevenLabs / LiveKit / Pipecat ingest automatically; you can also send calls programmatically.

## List calls

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    cekura calls list --project-id 742
    cekura calls list --agent-id 123 --format json | jq '.[] | .id, .duration'
    ```
  </Tab>

  <Tab title="SDK">
    ```python theme={null}
    calls = client.calls.list(project_id=742, page_size=50)
    for c in calls.get("results", calls):
        print(c["id"], c.get("duration"), c.get("call_ended_reason"))
    ```
  </Tab>
</Tabs>

Common filters: `project_id`, `agent_id`, `from_date`, `to_date`, `success`, `topic`. See the API Reference for the full list.

## Inspect a call

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    cekura calls get 7788
    ```
  </Tab>

  <Tab title="SDK">
    ```python theme={null}
    call = client.calls.get(call_id=7788)
    print(call["transcript"])
    print(call["metric_evaluations"])
    ```
  </Tab>
</Tabs>

## Send a call for evaluation

If your provider isn't on the auto-ingestion list — or you want to ship a call from your own backend — send it explicitly.

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    cekura calls send --from-file call.json
    ```

    Where `call.json` contains the agent ID, transcript, duration, and metadata.
  </Tab>

  <Tab title="SDK">
    ```python theme={null}
    client.calls.send(
        agent=123,
        transcript=[
            {"role": "agent", "text": "How can I help?"},
            {"role": "user",  "text": "I'd like to reschedule my appointment."},
        ],
        duration=124,
        metadata={"source": "internal-bot"},
    )
    ```

    Provider-specific webhook helpers are also available:

    ```python theme={null}
    client.calls.observe_vapi(payload=...)
    client.calls.observe_retell(payload=...)
    client.calls.observe_elevenlabs(payload=...)
    client.calls.observe_livekit(payload=...)
    client.calls.observe_pipecat(payload=...)
    ```

    In production these are usually wired as webhooks pointing at your backend or directly at `api.cekura.ai/observe` — the SDK helpers are useful for replays and testing.
  </Tab>
</Tabs>

## Run metrics on a call

Score an already-ingested call against one or more metrics.

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    cekura calls evaluate 7788 --metric-ids 55,56

    # Re-run a previous evaluation (e.g. after editing a metric prompt)
    cekura calls rerun-evaluation 7788 --metric-ids 55
    ```
  </Tab>

  <Tab title="SDK">
    ```python theme={null}
    client.calls.evaluate_metrics(call_log_id=7788, metric_ids=[55, 56])

    # Re-run a previous evaluation
    client.calls.rerun_evaluation(call_log_id=7788, metric_ids=[55])
    ```
  </Tab>
</Tabs>

## Generate scenarios from real calls

Found an interesting production call? Turn it into regression scenarios.

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    cekura calls create-scenarios 7788 --count 3
    cekura calls create-scenarios-progress --progress-id <id>
    ```
  </Tab>

  <Tab title="SDK">
    ```python theme={null}
    job = client.calls.create_scenarios(call_log_id=7788, count=3)
    client.calls.create_scenarios_progress(progress_id=job["progress_id"])
    ```
  </Tab>
</Tabs>

## Promote a call into a test set

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    cekura test-sets create-from-call-log \
      --call-log-id 7788 \
      --name "support-edge-cases"
    ```
  </Tab>

  <Tab title="SDK">
    ```python theme={null}
    client.test_sets.create_from_call_log(
        call_log_id=7788,
        name="support-edge-cases",
    )
    ```
  </Tab>
</Tabs>

## Vote on a metric result

Capture thumbs up/down feedback on a specific metric evaluation for a call, optionally attach the expected value and free-text feedback. The call is marked as reviewed; the metric evaluation is updated. Feeds the labs / metric-review workflow.

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    # Thumbs up — agreement with the metric's verdict
    cekura calls mark-metric-vote 7788 \
      --metric-id 55 \
      --thumbs-up \
      --expected-value 5 \
      --feedback "Agent greeted correctly"

    # Thumbs down — disagreement, supply what you'd have expected
    cekura calls mark-metric-vote 7788 \
      --metric-id 55 \
      --thumbs-down \
      --expected-value 2 \
      --feedback "Greeting was too curt"
    ```

    `--expected-value` is parsed as JSON when possible (`5`, `true`, `"foo"`), so numeric / boolean metrics get the right type.
  </Tab>

  <Tab title="SDK">
    ```python theme={null}
    client.calls.mark_metric_vote(
        call_log_id=7788,
        metric_id=55,
        thumbs_up=True,
        expected_value=5,
        feedback="Agent greeted correctly",
    )
    ```
  </Tab>
</Tabs>

## Flag a critical-scenario verdict as wrong

If a critical-scenario evaluation looks incorrect, flag it (and later unflag if it was a misclick or has since been corrected).

<Tabs>
  <Tab title="SDK">
    ```python theme={null}
    client.calls.mark_critical_scenario_wrong(call_log_id=7788, scenario_id=42)
    client.calls.unmark_critical_scenario_wrong(call_log_id=7788, scenario_id=42)
    ```
  </Tab>
</Tabs>

## Improve the agent's prompt from real failures

Use the failure pattern across recent calls to suggest a prompt improvement.

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    cekura calls improve-prompt --agent-id 123 --lookback-days 7
    cekura calls improve-prompt-progress --progress-id <id>
    ```
  </Tab>

  <Tab title="SDK">
    ```python theme={null}
    job = client.calls.improve_prompt(agent_id=123, lookback_days=7)
    client.calls.improve_prompt_progress(progress_id=job["progress_id"])
    ```
  </Tab>
</Tabs>

## See also

<CardGroup cols={2}>
  <Card title="Metrics" icon="database" href="/cli-sdk/metrics">
    Define what you score production calls on.
  </Card>

  <Card title="Runs & Results" icon="play" href="/cli-sdk/runs">
    Same scoring engine — for simulated, not production, traffic.
  </Card>

  <Card title="Dashboards" icon="chart-line" href="/api-reference">
    Visualize call quality and metric trends over time.
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference">
    Full field reference for call logs and observation payloads.
  </Card>
</CardGroup>
