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

# Listing Test Cases

> List all test cases associated with a specific dataset.

> [!WARNING]
>
> You are reading the docs of Galtea 5.10. [Read this page in the latest version](https://docs.galtea.ai/sdk/api/test-case/list.md).

## Returns

Returns a list of [TestCase](https://docs.galtea.ai/v5.10/concepts/product/dataset/test-case.md) objects for the given dataset.

## Example

```python theme={"system"}
test_cases = galtea.test_cases.list(dataset_id=dataset_id, limit=20)
```

## Parameters

**dataset\_id** `string | list[string]`

The ID or IDs of the dataset you want to get the test cases from.

> [!NOTE]
>
> Deprecated alias: `test_id`.

**languages** `list[string]`

Languages to filter test cases by. Accepts [BCP-47 language tags](https://en.wikipedia.org/wiki/IETF_language_tag) — a bare ISO 639-1 code (`"es"`) or a code with a region subtag (`"es-MX"`).

* [https://en.wikipedia.org/wiki/IETF\_language\_tag](https://en.wikipedia.org/wiki/IETF_language_tag)

**variants** `list[string]`

The list of variants to filter by.

**strategies** `list[string]`

The list of strategies to filter by.

**expected\_tools** `list[string]`

The list of expected tools to filter by. It will retrieve test cases that contain exactly the same specified tools or more.

**reviewed** `bool`

Filter by reviewed status.

**user\_score** `int`

Filter by user score (0 for unreviewed, 1 for good quality, -1 for bad quality).

**from\_created\_at** `str | int` (default: None)

Filter test cases created at or after this timestamp. Accepts ISO 8601 string (e.g., `'2024-01-01T00:00:00Z'`) or Unix timestamp in seconds. Can be used independently or together with `to_created_at`.

**to\_created\_at** `str | int` (default: None)

Filter test cases created at or before this timestamp. Accepts ISO 8601 string (e.g., `'2024-12-31T23:59:59Z'`) or Unix timestamp in seconds. Can be used independently or together with `from_created_at`.

**sort\_by\_created\_at** `string`

Sort test cases by creation date. Valid values are "asc" and "desc".

**offset** `int` (default: 0)

Number of test cases to skip before starting to collect results. Use for pagination.

**Default:** `0` (start from the beginning)

**limit** `int` (default: 10000)

Maximum number of test cases to return in a single request.

**Default:** `10000`

**include\_legacy** `bool` (default: True)

Whether to include superseded (legacy) test-case revisions in the results.

**Default:** `True` — a family's older revisions are returned alongside its current active revision, matching the API. Set to `False` to return only the active head of each revision family.

**id** `string | list[string]` (default: None)

The ID or IDs of the test case(s) to retrieve.

**input** `string`

Case-insensitive substring filter applied across the test case input JSON values. Only test cases whose input contains this substring (when cast to text) are returned.

> [!NOTE]
>
> At least one of the 2 filter parameters (`dataset_id`, `id`) described above must be passed to the method


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