---
title: "Get Model Datasets"
method: GET
path: "/analytics/model-datasets"
tags: ["analytics"]
---

# Get Model Datasets

`GET /analytics/model-datasets`

Return training + evaluation datasets for a project or base model.

Exactly one of ``project_id`` or ``base_model`` must be provided.

Args:
    project_id: Scope to datasets directly attached to this project,
        or the sentinel ``"default"`` for unallocated datasets.
    base_model: Scope to datasets used by training jobs and
        evaluations against this base model id.
    auth: Authentication result carrying the user id and team scope.

Returns:
    ``ModelDatasetsResponse`` with training and evaluation dataset
    rows. Evaluation rows include their latest completed evaluation
    when available.

Raises:
    HTTPException: 400 when the scope parameters are not exactly one of
        ``project_id`` / ``base_model``, or the service rejects the
        input; 503 when the datasets read fails, with the cause logged
        server-side rather than returned to the caller.

## Query parameters

- `project_id` string, nullable — Project UUID. Returns datasets attached to this project. Pass the literal value 'default' to return datasets whose project_id is null (the unallocated-resources bucket). Mutually exclusive with 'base_model' -- exactly one of the two must be provided.
- `base_model` string, nullable — Base catalog model id (e.g. 'meta-llama/Llama-3-8B'). Mutually exclusive with 'project_id' -- exactly one of the two must be provided.

## Response `200`

Successful Response

- ModelDatasetsResponse — Datasets scoped to either a project or a base model. Training rows come from ``datasets.type = 'training'``; evaluation rows come from ``datasets.type IN ('evaluation', 'benchmark')`` and carry their most recent completed evaluation against the model.
  - `training_datasets` TrainingDatasetRow[]
    - `id` string, required
    - `dataset_name` string, required
    - `version_number` string, required
    - `dataset_type` string, nullable — Domain type of the dataset (ner, classification, custom, decoder).
    - `generation_type` string, nullable — How the dataset was created: synthesize, upload, auto_relabel, manual_relabel, grow, external.
    - `sample_size` integer, nullable
    - `updated_at` string, date-time, nullable
    - `provenance` DatasetProvenance — Record how a dataset was created and which inputs produced it. Attributes: schema_version: Contract version for future migrations. method: Canonical dataset generation type. sources: External source descriptors. fallback: Fallback reason and attempt count, when one was required. source_dataset_ids: Dataset inputs combined or transformed. parent_dataset_id: Immediate dataset version or transform parent. transform_context: Bounded details about a transform. generator_context: Bounded generator configuration or agent context. synthesis_session_id: Synthesis-log session shared with the dataset row.
      - `schema_version` 1
      - `method` 'synthesize' | 'upload' | 'external' | 'grow' | 'augment' | 'version' | 'merge' | 'auto_relabel' | 'manual_relabel' | 'evaluation_suite' | 'agent_curated', required
      - `sources` DatasetProvenanceSource[]
        - `url` string, nullable
        - `revision` string, nullable
        - `license` string, nullable
        - `retrieved_at` string, date-time, nullable
        - `raw_hash` string, nullable
      - `fallback` DatasetProvenanceFallback — Describe a fallback used after the preferred source or strategy failed. Attributes: reason: Why the preferred path could not be used. attempts: Number of attempts made before the fallback succeeded.
        - `reason` string, required
        - `attempts` integer, required
      - `source_dataset_ids` string[]
      - `parent_dataset_id` string, nullable
      - `transform_context` JsonObjectOutput
      - `generator_context` JsonObjectOutput
      - `synthesis_session_id` string, nullable
  - `evaluation_datasets` EvaluationDatasetRow[]
    - `id` string, required
    - `dataset_name` string, required
    - `version_number` string, required
    - `dataset_type` string, nullable — Domain type of the dataset (ner, classification, custom, decoder).
    - `generation_type` string, nullable — How the dataset was created: synthesize, upload, auto_relabel, manual_relabel, grow, external.
    - `sample_size` integer, nullable
    - `updated_at` string, date-time, nullable
    - `provenance` DatasetProvenance — Record how a dataset was created and which inputs produced it. Attributes: schema_version: Contract version for future migrations. method: Canonical dataset generation type. sources: External source descriptors. fallback: Fallback reason and attempt count, when one was required. source_dataset_ids: Dataset inputs combined or transformed. parent_dataset_id: Immediate dataset version or transform parent. transform_context: Bounded details about a transform. generator_context: Bounded generator configuration or agent context. synthesis_session_id: Synthesis-log session shared with the dataset row.
      - `schema_version` 1
      - `method` 'synthesize' | 'upload' | 'external' | 'grow' | 'augment' | 'version' | 'merge' | 'auto_relabel' | 'manual_relabel' | 'evaluation_suite' | 'agent_curated', required
      - `sources` DatasetProvenanceSource[]
        - `url` string, nullable
        - `revision` string, nullable
        - `license` string, nullable
        - `retrieved_at` string, date-time, nullable
        - `raw_hash` string, nullable
      - `fallback` DatasetProvenanceFallback — Describe a fallback used after the preferred source or strategy failed. Attributes: reason: Why the preferred path could not be used. attempts: Number of attempts made before the fallback succeeded.
        - `reason` string, required
        - `attempts` integer, required
      - `source_dataset_ids` string[]
      - `parent_dataset_id` string, nullable
      - `transform_context` JsonObjectOutput
      - `generator_context` JsonObjectOutput
      - `synthesis_session_id` string, nullable
    - `latest_evaluation` DatasetEvaluationSummary — Latest evaluation attached to an evaluation dataset row. Used on the Datasets tab to surface the most recent pass-rate / loss for a given evaluation dataset against the model in context.
      - `evaluation_id` string, required
      - `accuracy` number, nullable
      - `f1_score` number, nullable
      - `sample_count` integer, nullable
      - `completed_at` string, date-time, nullable

## Other responses

- `400` — Exactly one scope parameter must be provided.
- `422` — Validation Error
- `503` — Model datasets dependency is temporarily unavailable.

## Changes

- **2026-09-24** `1cffaad2a921` — 1 warning, 3 info
  - removed the optional property `detail` from the response with the `422` status
  - added the optional property `evaluation_datasets/items/provenance` to the response with the `200` status
  - added the optional property `training_datasets/items/provenance` to the response with the `200` status
  - added the required property `error` to the response with the `422` status

[Change history](https://skmtc.dev/pioneer/apis/brain-api/changes/analytics/model-datasets/get.md)

---

[API](https://skmtc.dev/pioneer/apis/brain-api.md) · [All operations](https://skmtc.dev/pioneer/apis/brain-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pioneer/apis/brain-api/revisions/1cffaad2a921?raw)
