---
title: "Generate AI Prompt Fine-Tuning Dataset"
method: POST
path: "/users/{userId}/ai/prompts/{aiPromptId}/fine-tuning/datasets"
tags: ["AI"]
---

# Generate AI Prompt Fine-Tuning Dataset

`POST /users/{userId}/ai/prompts/{aiPromptId}/fine-tuning/datasets`

## Request

- Base URL: `https://api.crowdin.com/api/v2`
- URL: `https://api.crowdin.com/api/v2/users/{userId}/ai/prompts/{aiPromptId}/fine-tuning/datasets`
- Auth: none declared
- TypeScript: <https://skmtc.dev/crowdin/apis/crowdin-api-v2/docs/users/:userId/ai/prompts/:aiPromptId/fine-tuning/datasets/post.ts> (a function with typed inputs; its response is checked against the schema)

**Required scopes:** `ai.fine-tuning` (Read only).

## Path parameters

- `userId` integer, required
- `aiPromptId` integer, required

## Request body

- AiFineTuningDatasetGenerateForm
  - `projectIds` integer[]: Project identifiers from which the dataset will be generated. Get via [List Projects](#operation/api.projects.getMany). __Note__: Required if `tmIds` are not specified.
  - `tmIds` integer[]: TM identifiers from which the dataset will be generated. Get via [List TMs](#operation/api.tms.getMany). __Note__: This parameter is not supported for the prompt with the external configuration.
  - `purpose` 'training' | 'validation': Purpose of the dataset
  - `dateFrom` string, date-time: Start date for dataset generation
  - `dateTo` string, date-time: End date for dataset generation
  - `maxFileSize` integer: Maximum dataset file size in bytes. __Note__: If not provided, default limits based on the model will be applied
  - `minExamplesCount` integer: Minimum number of examples in the dataset. __Note__: If not provided, default limits based on the model will be applied
  - `maxExamplesCount` integer: Maximum number of examples in the dataset. __Note__: If not provided, default limits based on the model will be applied

## Response `202`

AI Prompt Fine-Tuning Dataset generation successfully started

- AiFineTuningDatasetResource: Base schema of resource container. Container is a wrapper object that contains payload in required `data` property and provides space for adding any other metadata.
  - `data` AiFineTuningDataset, required
    - `identifier` string
    - `status` string
    - `progress` integer: in percentages
    - `attributes` object
      - `projectIds` integer[], nullable
      - `tmIds` integer[], nullable
      - `purpose` 'training' | 'validation'
      - `dateFrom` string, date-time, nullable
      - `dateTo` string, date-time, nullable
      - `maxFileSize` integer, nullable
      - `minExamplesCount` integer, nullable
      - `maxExamplesCount` integer, nullable
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `startedAt` string, date-time
    - `finishedAt` string, date-time

## Other responses

- `400`: Invalid Request Parameters
- `401`: Unauthorized
- `403`: Forbidden
- `404`: User or AI prompt with specified id was not found
- `405`: Method Not Allowed

---

[API](https://skmtc.dev/crowdin/apis/crowdin-api-v2.md) - [All operations](https://skmtc.dev/crowdin/apis/crowdin-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/crowdin/apis/crowdin-api-v2/revisions/27aae7751699?raw)
