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

# Simulation testing

> Run graded simulation tests on a Retell AI agent: text, audio, and transcription test cases that catch regressions before each release reaches callers.

A simulation test runs a saved scenario against your agent without placing a call, and grades each run pass or fail. Build a set of test cases for the behavior that matters, then rerun them after every prompt, flow, or setting change to catch what broke before it reaches a real caller.

For example, a dental clinic keeps a test case where the caller wants to reschedule, has no appointment on file, and gets impatient. Its success criteria check that the agent looks up the record, offers to book a new visit instead, and never makes up an appointment time. If a prompt change breaks any of that, the run fails.

## When to use it

* **Before every release**, to check that a change didn't break behavior that used to work.
* **To cover edge cases** that are slow to reproduce by hand: an angry caller, a refusal to verify identity, a function that returns no results.
* **To measure speech recognition** on the names, numbers, and accents your callers actually use.
* **From real failures**, so a problem a caller hit once becomes a check that guards against it returning.

To try a change by hand first, use [manual testing](https://docs.retellai.com/test/manual-testing.md).

## Test types

| | Text | Audio | Transcription |
| - | - | - | - |
| **What plays the caller** | An AI caller that chats in text | An AI caller that speaks with a synthesized voice | A real recording of a caller |
| **What it checks** | Most of your agent's behavior. It's the fastest and cheapest way to see if your agent handles a conversation the way you expect. | The full call from end to end, including speech-only issues: mishearing what the caller says, and talking over them or cutting them off. | How accurately your agent transcribes real callers, so you can tell whether a change to your transcription settings helped. |
| **Graded by** | Your success criteria | Your success criteria | Word error rate and required words |
| **Agents** | Voice and chat agents | Voice agents | Voice agents |
| **Billed** | Per turn | Per minute | Per minute of audio |

Text tests are the fastest and cheapest, so keep most of your suite in text and add audio tests for what only speech can show. See [Text and audio tests](https://docs.retellai.com/test/text-and-audio-tests.md) and [Transcription tests](https://docs.retellai.com/test/transcription-tests.md).

## Where to find it

Open your agent and select `Simulation` in the left rail of the editor. The **Simulation Testing** page has two tabs:

* `Test Cases` lists every test case for the agent, where you create, import, edit, and run them.
* `Simulation Runs` lists every batch you've run, with each run's result. See [Run and review tests](https://docs.retellai.com/test/run-tests.md).

You can also run text and audio test cases one at a time from the `Simulation Test` tab of the [test panel](https://docs.retellai.com/test/manual-testing.md). Those single runs aren't saved to Simulation Runs.

![Simulation Testing page for a medical receptionist agent, on the Test Cases tab. The type filter shows All, Audio, Text, and Transcription, with Import and Add test buttons above it. On the right, the tag filter reads Tags: Scheduling, Safety, Refills and is open, saying it shows test cases with any of these tags, with Scheduling, Safety, and Refills checked. The list holds the seven matching test cases, each with a type icon: one transcription test (Refill caller name and medication), two audio tests (Reschedule from a busy street, Chest pain goes to clinical staff), and four text tests. Each row shows its tags, the caller instructions, the success criteria, and Edit, Run, and Delete buttons.](https://mintcdn.com/retellai/8ZCrhFAw4xq7qprW/images/test/simulation-testing-test-cases.png?fit=max\&auto=format\&n=8ZCrhFAw4xq7qprW\&q=85\&s=f68b711f6861f4da3110268fb7d4ef57)

The Test Cases tab lists every text, audio, and transcription test case for the agent. Filter it by type or by tag.

## How a run is graded

**Text and audio runs** pass only if every success criterion passes. A prompt criterion is judged by an LLM against the transcript and comes back with its own reason. An equation criterion compares a variable or metric to a value, with no LLM involved. See [success criteria](https://docs.retellai.com/test/text-and-audio-tests.md#define-success-criteria).

**Transcription runs** pass only if the word error rate is at or below your limit and every required word was heard. See [how a transcription test is graded](https://docs.retellai.com/test/transcription-tests.md#how-a-run-is-graded).

Each run ends with one of these results:

| Result | Meaning |
| - | - |
| **Passed** | Every check passed. |
| **Failed** | At least one check failed. The run details show which one and why. |
| **Error** | The run couldn't finish, so it wasn't graded. The error message says why. |
| **Cancelled** | You stopped the batch before this run finished. |

Common reasons a run ends in **Error**:

* The conversation went past 400 messages, or Retell detected a loop.
* The agent didn't answer 4 caller messages in a row.
* An audio run ended some other way than a hangup, such as reaching the agent's maximum call duration.
* The run hadn't finished 24 hours after the batch started.

Both the AI caller and the grader are LLMs, so the same test can pass one run and fail the next. Run a test case several times and judge it on its pass rate, not on a single run.

## What a test case contains

A text or audio test case describes a caller and how to grade the conversation:

* **Caller instructions**: who the caller is and what they want, or a transcript for the caller to follow.
* **Success criteria**: the checks that grade the run.
* **Performance metrics**: optional measurements such as hallucination rate or latency.
* **Starting point**: optionally, the node to start from and the first few messages.
* **Dynamic variables and function mocks**, so the run is realistic and repeatable.

An audio test case adds a caller voice and optional background noise. A transcription test case is different: it holds a recording, the expected transcript, and an error-rate limit.

## Agent support

* **Custom LLM agents** aren't supported. Runs fail with "Custom LLM agents do not support simulation tests."
* **Chat agents** support text tests only.
* **Agents on a duplex model** (`gpt-live-1` and `gpt-live-1.1`) don't support audio tests.
* **Flows in flex mode** always start from the start node, so a test case's starting node doesn't apply.

## Manage test cases

On the `Test Cases` tab, filter the list by type, or click `Filter by tags` to filter by tags. Use each row's `Edit`, `Run`, and `Delete` buttons. Check several rows to run, export, or delete them together. Deleting can't be undone.

### Import and export test cases

To copy test cases to another agent, check them and click `Export`. They download as a JSON array, `test-cases-<agent ID>.json`. On the other agent, click `Import` and drop the file in. A file can hold up to 100 test cases and be up to 5 MB, and each item needs a `type` of `text`, `audio`, or `asr` (transcription).

Retell checks every item before saving any of them, so a file with one invalid test case imports nothing. To start from scratch, download the JSON template from the import dialog.

## FAQ

> [accordion] Do simulation tests call my real functions?
>
> Yes, unless you mock them. Any function you don't mock runs for real, so a test can create a real booking or record. Text tests always call MCP tools for real. Transfers and SMS are always simulated in a simulation test, so they can't reach a real phone. See [function mocks](https://docs.retellai.com/test/text-and-audio-tests.md#mock-functions-and-tools).

> [accordion] Why did the same test pass and then fail?
>
> The caller and the grader are both LLMs, so runs vary. Run the test case several times, up to 10 runs per batch, and look at the pass rate. If it fails often, tighten the success criterion or the agent's prompt.

> [accordion] Which agent version does a test run against?
>
> The version you're viewing when you start the run. The run settings dialog shows it before you start. See [Run and review tests](https://docs.retellai.com/test/run-tests.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.