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

# Build Datasets

> Create datasets to test LLM models at scale. Define inputs, messages, and expected outputs for experiments. Manage datasets via the AI Studio, API, or Orq MCP.

Datasets hold the test data that powers [Experiments](https://docs.orq.ai/ai-studio/optimize/experiments.md). Each dataset row contains up to three fields:

* **Inputs**: Variables injected into the prompt at runtime, e.g. `{{firstname}}`.
* **Messages**: The prompt template, structured with system, user, and assistant roles.
* **Expected Output**: Reference responses evaluators compare against model outputs.

You don't need all three fields in every dataset. A dataset with only inputs, or only messages, is valid.

## Use Cases

> [accordion] Regression and pre-deployment testing
>
> Run the same dataset through your prompts before and after a change to verify that updates haven't degraded performance in any area.

> [accordion] Compare models and prompt variants
>
> Use the same dataset across multiple models or prompt configurations in an [Experiment](https://docs.orq.ai/ai-studio/optimize/experiments.md) to find the best combination of quality, cost, and latency.

> [accordion] Curated datasets for fine-tuning
>
> Have domain experts review and correct model outputs, then save those verified input/output pairs as a curated dataset to use as fine-tuning reference data.

> [accordion] Synthetic data generation at scale
>
> Use the Orq MCP to generate hundreds of realistic test cases programmatically and add them directly to a dataset without leaving your IDE.

> [accordion] Vision and image datasets
>
> Build datasets with image messages for testing vision models. Supports JPEG, PNG, GIF, and WebP via the AI Studio or API.

## Create a Dataset

> [tab] AI Studio
>
> Use the <kbd /> button on a [Project](https://docs.orq.ai/ai-studio/get-started/projects.md) folder and select **Dataset**. Enter a **Name** in the **Create dataset** dialog and select **Create**.
>
> The table has three columns: **Inputs**, **Messages**, and **Expected Output**. Add as many rows as needed.
>
> ![Create a Dataset](https://files.readme.io/6c5eb05e76d2417de2b84c55fd348af92f7f96183510b62d5b080312476ee05f-datasetsv2.gif)

> [tab] API & SDK
>
> Use the [Create Dataset API](https://docs.orq.ai/reference/datasets/create-a-dataset.md). A unique `display_name` and a `path` (the Project folder) are required.
>
> ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
> curl --request POST \
>      --url https://my.orq.ai/v2/datasets \
>      --header 'accept: application/json' \
>      --header "authorization: Bearer $ORQ_API_KEY" \
>      --header 'content-type: application/json' \
>      --data '{
>   "display_name": "MyDataset",
>   "path": "Default"
> }'
> ```
>
> ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
> from orq_ai_sdk import Orq
> import os
>
> with Orq(api_key=os.getenv("ORQ_API_KEY", "")) as orq:
>     res = orq.datasets.create(
>         display_name="MyDataset",
>         path="Default",
>     )
>     print(res)
> ```
>
> ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
> import { Orq } from "@orq-ai/node";
>
> const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "" });
>
> const result = await orq.datasets.create({
>   displayName: "MyDataset",
>   path: "Default",
> });
>
> console.log(result);
> ```
>
> The response includes a `_id` field (the dataset ID) used in subsequent calls.
>
> > [!TIP]
> >
> > See the full [Create Dataset API reference](https://docs.orq.ai/reference/datasets/create-a-dataset.md).

> [tab] CLI
>
> Create a dataset using [`orq datasets create`](https://docs.orq.ai/reference/cli):
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> orq datasets create \
>   --display-name "MyDataset" \
>   --path Default
> ```
>
> > [!TIP]
> >
> > See [install and setup](https://docs.orq.ai/reference/cli.md) to get started with the CLI. Run `orq datasets create --help` for the full flag reference.

> [tab] MCP
>
> **Create a dataset:**
>
> ```prompt wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
> Create a dataset called "Support Training Data" in the Default project
> ```
>
> The assistant uses `create_dataset` with the display name and path.
>
> ***
>
> **Generate a synthetic dataset:**
>
> ```prompt wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
> Generate 50 realistic customer support questions about a SaaS product and create a dataset called "Support Training Data"
> ```
>
> The assistant generates the entries, uses `create_dataset` to create the dataset, then uses `create_datapoints` to add all entries in bulk.
>
> ***
>
> **Find an existing dataset:**
>
> ```prompt wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
> Find the "user-queries" dataset in my workspace
> ```
>
> The assistant uses `search_entities` with `type: "dataset"` to locate it by name.

### Add Datapoints

> [tab] AI Studio
>
> **Manually:** Click **Add Row** and fill in each cell.
>
> **From CSV:** Click **Import** and drag-and-drop a `.csv` file. Map each CSV column to a role: **Inputs**, **Messages**, **Expected Output**, or **Exclude**. Each row becomes a separate datapoint.

> [tab] API & SDK
>
> Use the [Create Datapoints API](https://docs.orq.ai/reference/datasets/create-a-datapoint.md). Send between 1 and 5,000 datapoints per request. Requests over 500 datapoints are automatically chunked.
>
> ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
> curl --request POST \
>      --url https://my.orq.ai/v2/datasets/DATASET_ID/datapoints \
>      --header 'accept: application/json' \
>      --header "authorization: Bearer $ORQ_API_KEY" \
>      --header 'content-type: application/json' \
>      --data '[
>   {
>     "inputs": {"country": "France"},
>     "messages": [
>       {"role": "user", "content": "Capital of {{country}}?"},
>       {"role": "assistant", "content": "Paris"}
>     ],
>     "expected_output": "Paris"
>   },
>   {
>     "inputs": {"country": "Germany"},
>     "messages": [
>       {"role": "user", "content": "Capital of {{country}}?"},
>       {"role": "assistant", "content": "Berlin"}
>     ],
>     "expected_output": "Berlin"
>   }
> ]'
> ```
>
> ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
> from orq_ai_sdk import Orq
> import os
>
> with Orq(api_key=os.getenv("ORQ_API_KEY", "")) as orq:
>     res = orq.datasets.create_datapoint(
>         dataset_id="DATASET_ID",
>         request_body=[
>             {
>                 "inputs": {"country": "France"},
>                 "messages": [
>                     {"role": "user", "content": "Capital of {{country}}?"},
>                     {"role": "assistant", "content": "Paris"}
>                 ],
>                 "expected_output": "Paris"
>             },
>             {
>                 "inputs": {"country": "Germany"},
>                 "messages": [
>                     {"role": "user", "content": "Capital of {{country}}?"},
>                     {"role": "assistant", "content": "Berlin"}
>                 ],
>                 "expected_output": "Berlin"
>             }
>         ]
>     )
>     print(f"Created {len(res)} datapoints")
> ```
>
> ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
> import { Orq } from "@orq-ai/node";
>
> const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "" });
>
> await orq.datasets.createDatapoint({
>   datasetId: "DATASET_ID",
>   requestBody: [
>     {
>       inputs: { country: "France" },
>       messages: [
>         { role: "user", content: "Capital of {{country}}?" },
>         { role: "assistant", content: "Paris" }
>       ],
>       expectedOutput: "Paris"
>     },
>     {
>       inputs: { country: "Germany" },
>       messages: [
>         { role: "user", content: "Capital of {{country}}?" },
>         { role: "assistant", content: "Berlin" }
>       ],
>       expectedOutput: "Berlin"
>     }
>   ]
> });
> ```
>
> > [accordion] Large batch example (1,000 datapoints)
> >
> > ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
> > from orq_ai_sdk import Orq
> > import os
> >
> > with Orq(api_key=os.getenv("ORQ_API_KEY", "")) as orq:
> >     datapoints = []
> >     for i in range(1000):
> >         datapoints.append({
> >             "inputs": {"number": i, "operation": "square"},
> >             "messages": [
> >                 {"role": "user", "content": f"What is {i} squared?"},
> >                 {"role": "assistant", "content": f"{i} squared is {i**2}"}
> >             ],
> >             "expected_output": str(i**2)
> >         })
> >
> >     res = orq.datasets.create_datapoint(
> >         dataset_id="DATASET_ID",
> >         request_body=datapoints
> >     )
> >     print(f"Created {len(res)} datapoints")
> > ```
>
> > [!TIP]
> >
> > See the full [Create Datapoints API reference](https://docs.orq.ai/reference/datasets/create-a-datapoint.md).

> [tab] CLI
>
> Add datapoints using [`orq datasets create-datapoint`](https://docs.orq.ai/reference/cli). The request body is an array of datapoints, piped via stdin:
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> echo '[
>   {
>     "inputs": {"country": "France"},
>     "messages": [
>       {"role": "user", "content": "Capital of {{country}}?"},
>       {"role": "assistant", "content": "Paris"}
>     ],
>     "expected_output": "Paris"
>   },
>   {
>     "inputs": {"country": "Germany"},
>     "messages": [
>       {"role": "user", "content": "Capital of {{country}}?"},
>       {"role": "assistant", "content": "Berlin"}
>     ],
>     "expected_output": "Berlin"
>   }
> ]' | orq datasets create-datapoint <dataset_id> --stdin
> ```
>
> > [!TIP]
> >
> > See [install and setup](https://docs.orq.ai/reference/cli.md) to get started with the CLI. Run `orq datasets create-datapoint --help` for the full flag reference.

> [tab] MCP
>
> **Add datapoints to an existing dataset:**
>
> ```prompt wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
> Import this JSON array as datapoints into the "Support Training Data" dataset
> ```
>
> The assistant uses `create_datapoints` to add entries in batches (max 100 per call).
>
> ***
>
> **Update a datapoint:**
>
> ```prompt wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
> Update the expected output of datapoint ID "abc123" in the "user-queries" dataset to "New expected answer"
> ```
>
> The assistant uses `update_datapoint` with the datapoint ID and updated fields.
>
> ***
>
> **Clean up a dataset:**
>
> ```prompt wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
> Delete all datapoints in the "staging-tests" dataset that have an empty expected_output field
> ```
>
> The assistant uses `list_datapoints` to retrieve all entries, filters for empty `expected_output`, then uses `delete_datapoints` to remove them in batches.

### Create Image Datasets

> [tab] AI Studio
>
> Start by [creating a dataset](#create-a-dataset), then add messages with images.
>
> When editing a message cell:
>
> 1. Click **Add image** in the message editor.
>
> ![User message input box with an Add image button in the bottom-right corner.](https://mintcdn.com/orqai/UEF-O8ISq_K3Qbdc/images/studio-add-image-button.png?fit=max\&auto=format\&n=UEF-O8ISq_K3Qbdc\&q=85\&s=86af146bb4d0a2e988bcc62ecb653229)
>
> Click the Add image button to include images in your messages.
>
> 2. Choose how to provide the image:
>    * **Upload locally**: Select a file from your computer.
>    * **Enter URL**: Paste an image URL directly.
>
> ![URL input field for entering an image URL, with a Select image button to browse locally.](https://mintcdn.com/orqai/UEF-O8ISq_K3Qbdc/images/studio-image-url-input.png?fit=max\&auto=format\&n=UEF-O8ISq_K3Qbdc\&q=85\&s=5e13b4d60dd39e68e03774cbe6d84b6d)
>
> Enter an image URL or upload a local image file.
>
> ![Animated walkthrough of adding an image to a dataset message by URL or local file upload.](https://mintcdn.com/orqai/To3XzWzRTtsV_zsh/images/add-image-dataset.gif?s=2e4dbd94e1c7196094e7fcbb96662366)
>
> Complete workflow: Adding images to dataset messages.
>
> **Supported formats:** JPEG, PNG, GIF, WebP.

> [tab] API & SDK
>
> Images must be encoded as base64 data URLs before adding to the dataset.
>
> **1. Create a Dataset**
>
> ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
> curl -X POST https://my.orq.ai/v2/datasets \
>   -H "Authorization: Bearer $ORQ_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "display_name": "Image Analysis Dataset",
>     "path": "Default"
>   }'
> ```
>
> ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
> response = orq.datasets.create(
>     display_name="Image Analysis Dataset", path="Default"
> )
> dataset_id = response.id
> ```
>
> ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
> const dataset = await orq.datasets.create({
>   displayName: "Image Analysis Dataset",
>   path: "Default",
> });
> const datasetId = dataset.id;
> ```
>
> **2. Convert Images to Base64**
>
> ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
> import base64
>
> def image_to_base64(image_path):
>     with open(image_path, "rb") as f:
>         encoded = base64.b64encode(f.read()).decode("utf-8")
>     ext = image_path.lower().split(".")[-1]
>     mime_types = {"png": "image/png", "gif": "image/gif", "webp": "image/webp",
>                   "jpg": "image/jpeg", "jpeg": "image/jpeg"}
>     mime_type = mime_types.get(ext, "image/jpeg")
>     return f"data:{mime_type};base64,{encoded}"
> ```
>
> ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
> import fs from "fs";
> import path from "path";
>
> function imageToBase64(imagePath: string): string {
>   const encoded = fs.readFileSync(imagePath).toString("base64");
>   const ext = path.extname(imagePath).toLowerCase();
>   const mimeTypes: Record<string, string> = {
>     ".png": "image/png", ".gif": "image/gif", ".webp": "image/webp",
>     ".jpg": "image/jpeg", ".jpeg": "image/jpeg",
>   };
>   return `data:${mimeTypes[ext] || "image/jpeg"};base64,${encoded}`;
> }
> ```
>
> **3. Add Images to the Dataset**
>
> ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
> DATASET_ID="DATASET_ID"
> IMAGE_DATA=$(base64 < "/path/to/image.jpg" | tr -d '\n')
>
> curl -X POST "https://my.orq.ai/v2/datasets/$DATASET_ID/datapoints" \
>   -H "Authorization: Bearer $ORQ_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "messages": [{
>       "role": "user",
>       "content": [
>         {"type": "text", "text": "Describe what you see in this image"},
>         {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,'$IMAGE_DATA'", "detail": "auto"}}
>       ]
>     }]
>   }'
> ```
>
> ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
> orq.datasets.create_datapoint(
>     dataset_id=dataset_id,
>     request_body=[{
>         "messages": [{
>             "role": "user",
>             "content": [
>                 {"type": "text", "text": "Describe what you see in this image"},
>                 {"type": "image_url", "image_url": {"url": image_to_base64("/path/to/image.jpg"), "detail": "auto"}}
>             ]
>         }]
>     }]
> )
> ```
>
> ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
> await orq.datasets.createDatapoint({
>   datasetId,
>   requestBody: [{
>     messages: [{
>       role: "user",
>       content: [
>         { type: "text", text: "Describe what you see in this image" },
>         { type: "image_url", imageUrl: { url: imageToBase64("/path/to/image.jpg"), detail: "auto" } }
>       ]
>     }]
>   }]
> });
> ```
>
> **Detail parameter:**
>
> | Value | Behaviour |
> | - | - |
> | `auto` (recommended) | Automatically optimises based on image size |
> | `low` | Faster processing, lower token usage |
> | `high` | More detailed analysis, higher token usage |
>
> **Supported formats:**
>
> | Format | MIME Type | Extension |
> | - | - | - |
> | JPEG | `image/jpeg` | `.jpg`, `.jpeg` |
> | PNG | `image/png` | `.png` |
> | GIF | `image/gif` | `.gif` |
> | WebP | `image/webp` | `.webp` |
>
> **Common errors:**
>
> | Error | Cause | Solution |
> | - | - | - |
> | Invalid API key | Authentication failed | Check your API key in the workspace settings |
> | File not found | Image path is incorrect | Verify the path and file permissions |
> | Unsupported format | Format not supported | Convert to JPEG, PNG, GIF, or WebP |
> | Payload too large | Image file is too large | Compress or resize before upload |

> [tab] CLI
>
> Encode the image as a base64 data URL, then add it as a datapoint using [`orq datasets create-datapoint`](https://docs.orq.ai/reference/cli):
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> IMAGE_DATA=$(base64 < /path/to/image.jpg | tr -d '\n')
>
> echo '[{
>   "messages": [{
>     "role": "user",
>     "content": [
>       {"type": "text", "text": "Describe what you see in this image"},
>       {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,'"$IMAGE_DATA"'", "detail": "auto"}}
>     ]
>   }]
> }]' | orq datasets create-datapoint <dataset_id> --stdin
> ```
>
> > [!TIP]
> >
> > See [install and setup](https://docs.orq.ai/reference/cli.md) to get started with the CLI. Run `orq datasets create-datapoint --help` for the full flag reference.

### Create File and PDF Datasets

A datapoint carries a document in a `file` content part. Datapoints take the Chat Completions shape, not the `input_file` shape of the Responses API:

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl --request POST \
     --url https://my.orq.ai/v2/datasets/DATASET_ID/datapoints \
     --header 'content-type: application/json' \
     --header "authorization: Bearer $ORQ_API_KEY" \
     --data '[
  {
    "inputs": {"invoice": "invoice.pdf"},
    "messages": [
      {
        "role": "user",
        "content": [
          {"type": "text", "text": "Extract the total from this invoice"},
          {"type": "file", "file": {
            "file_data": "data:application/pdf;base64,JVBERi0xLjQK...",
            "filename": "invoice.pdf"
          }}
        ]
      }
    ],
    "expected_output": "1240.00"
  }
]'
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
import base64
import os
from pathlib import Path

from orq_ai_sdk import Orq

pdf = base64.b64encode(Path("invoice.pdf").read_bytes()).decode("utf-8")
part = {"type": "file", "file": {"file_data": f"data:application/pdf;base64,{pdf}", "filename": "invoice.pdf"}}

with Orq(api_key=os.environ["ORQ_API_KEY"]) as orq:
    orq.datasets.create_datapoint(
        dataset_id="DATASET_ID",
        request_body=[{
            "inputs": {"invoice": "invoice.pdf"},
            "messages": [{"role": "user", "content": [
                {"type": "text", "text": "Extract the total from this invoice"},
                part,
            ]}],
            "expected_output": "1240.00",
        }],
    )
```

```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
import fs from "fs";
import { Orq } from "@orq-ai/node";

const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "" });
const pdf = fs.readFileSync("invoice.pdf").toString("base64");

await orq.datasets.createDatapoint({
  datasetId: "DATASET_ID",
  requestBody: [
    {
      inputs: { invoice: "invoice.pdf" },
      messages: [
        {
          role: "user",
          content: [
            { type: "text", text: "Extract the total from this invoice" },
            {
              type: "file",
              file: { fileData: `data:application/pdf;base64,${pdf}`, filename: "invoice.pdf" },
            },
          ],
        },
      ],
      expectedOutput: "1240.00",
    },
  ],
});
```

In place of `file_data`, the part takes a `file_id` from an uploaded [file](https://docs.orq.ai/ai-studio/ai-engineering/files.md) or a `uri`.

The `messages` payload counts against a 100 MB request body, and base64 adds about a third to the file size. When the datapoint is saved, base64 media in a user message moves to object storage: the stored message keeps a reference to the object instead of the bytes.

The model must accept the document: [Sending files to models](https://docs.orq.ai/ai-gateway/features/files.md) lists the types each model takes. An Experiment or Agent run sends the row's `messages` as the request and resolves the object reference, so the model receives the document.

### Create Curated Datasets

Curated datasets are human-evaluated input and output sets: a prompt paired with a verified expected output. They are used for fine-tuning and as a gold-standard reference in Experiments.

Within any module, open the **Logs** tab and select a log entry. The **Feedback** panel appears on the right.

To add a correction, click **Add correction** below the assistant response:

![Assistant response box with an Add correction button highlighted in red below it.](https://mintcdn.com/orqai/83k4_RKHhrJhLScC/images/logs-add-correction-button.png?fit=max\&auto=format\&n=83k4_RKHhrJhLScC\&q=85\&s=308c61614973cde35b1e94a9cee6a108)

The Add correction button is below the assistant response.

Edit the response in the **Correction** message that opens, then click **Save**.

![Original assistant response shown in purple above a Correction box in green, with the corrected text entered and a Save button.](https://mintcdn.com/orqai/83k4_RKHhrJhLScC/images/logs-correction-editor.png?fit=max\&auto=format\&n=83k4_RKHhrJhLScC\&q=85\&s=46554b2e2dee2276cc1cbf0fcaabcbbb)

The original and corrected responses appear side by side. The correction is shown in green.

Click the **Add to Dataset** icon at the top-right of the response to save the corrected entry to a dataset:

![Log view showing an Add to dataset dropdown with curated dataset selected, a Replace Inputs toggle, and an Add to dataset button.](https://mintcdn.com/orqai/83k4_RKHhrJhLScC/images/datasets-add-to-dataset-dialog.png?fit=max\&auto=format\&n=83k4_RKHhrJhLScC\&q=85\&s=a94a52d6bad974501a73fa04d235784e)

Choose to replace the inputs used during generation (recommended).

> [!NOTE]
>
> Import a curated dataset into an [Experiment](https://docs.orq.ai/ai-studio/optimize/experiments.md), attach an [Evaluator](https://docs.orq.ai/ai-studio/optimize/evaluators.md), and see which model or prompt scores best against the curated reference outputs.

## List and Retrieve Datasets

> [tab] API & SDK
>
> **List datasets:**
>
> ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
> curl --request GET \
>      --url https://my.orq.ai/v2/datasets \
>      --header 'accept: application/json' \
>      --header "authorization: Bearer $ORQ_API_KEY"
> ```
>
> ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
> from orq_ai_sdk import Orq
> import os
>
> with Orq(api_key=os.getenv("ORQ_API_KEY", "")) as orq:
>     res = orq.datasets.list(limit=10)
>     print(res)
> ```
>
> ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
> import { Orq } from "@orq-ai/node";
>
> const orq = new Orq({ apiKey: process.env["ORQ_API_KEY"] ?? "" });
> const result = await orq.datasets.list({});
> console.log(result);
> ```
>
> **Retrieve a dataset by ID:**
>
> ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
> curl --request GET \
>      --url https://my.orq.ai/v2/datasets/DATASET_ID \
>      --header 'accept: application/json' \
>      --header "authorization: Bearer $ORQ_API_KEY"
> ```
>
> ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
> with Orq(api_key=os.getenv("ORQ_API_KEY", "")) as orq:
>     res = orq.datasets.retrieve(dataset_id="DATASET_ID")
>     print(res)
> ```
>
> ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
> const result = await orq.datasets.retrieve({ datasetId: "DATASET_ID" });
> console.log(result);
> ```
>
> > [!TIP]
> >
> > See the [List Datasets](https://docs.orq.ai/reference/datasets/list-datasets.md) and [Retrieve a Dataset](https://docs.orq.ai/reference/datasets/retrieve-a-dataset.md) API references.

> [tab] CLI
>
> List and retrieve datasets using [`orq datasets list`](https://docs.orq.ai/reference/cli) and [`orq datasets retrieve`](https://docs.orq.ai/reference/cli):
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> # List datasets
> orq datasets list --limit 10
>
> # Retrieve a dataset
> orq datasets retrieve <dataset_id>
> ```
>
> > [!TIP]
> >
> > See [install and setup](https://docs.orq.ai/reference/cli.md) to get started with the CLI. Run `orq datasets list --help` or `orq datasets retrieve --help` for the full flag reference.

> [tab] MCP
>
> **List datasets in a project:**
>
> ```prompt wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
> List all datasets in my workspace
> ```
>
> The assistant uses `search_entities` with `type: "dataset"`.
>
> ***
>
> **Find a specific dataset:**
>
> ```prompt wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
> Find the "user-queries" dataset and show me its datapoints
> ```
>
> The assistant uses `search_entities` to locate the dataset, then `list_datapoints` to retrieve its entries.


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