---
title: "Create AI Prompt Fine-Tuning Job"
method: POST
path: "/ai/prompts/{aiPromptId}/fine-tuning/jobs"
tags: ["AI"]
---

# Create AI Prompt Fine-Tuning Job

`POST /ai/prompts/{aiPromptId}/fine-tuning/jobs`

## Request

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

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

## Path parameters

- `aiPromptId` integer, required

## Request body

- AiFineTuningJobCreateForm
  - `dryRun` boolean: Simulate the fine-tuning of job creation without actually creating them
  - `hyperparameters` object: The hyperparameters used for the fine-tuning job.
    - `batchSize` integer: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. __Note__: This parameter is not supported by Mistral AI.
    - `learningRateMultiplier` number: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. __Note__: This parameter is not supported by Mistral AI.
    - `nEpochs` integer: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
  - `trainingOptions` object, required: Options for generating the training dataset.
    - `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.
    - `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
  - `validationOptions` object: Options for generating the validation dataset.
    - `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.
    - `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 Job created successfully

- AiFineTuningJobResource: 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` AiFineTuningJob, required
    - `identifier` string
    - `status` string
    - `progress` integer: in percentages
    - `attributes` object
      - `dryRun` boolean
      - `aiPromptId` integer
      - `hyperparameters` object, nullable
        - `batchSize` integer, nullable
        - `learningRateMultiplier` number, nullable
        - `nEpochs` integer, nullable
      - `trainingOptions` object
        - `projectIds` integer[], nullable
        - `tmIds` integer[], nullable
        - `dateFrom` string, date-time, nullable
        - `dateTo` string, date-time, nullable
        - `maxFileSize` integer, nullable
        - `minExamplesCount` integer, nullable
        - `maxExamplesCount` integer, nullable
      - `validationOptions` object, nullable
        - `projectIds` integer[], nullable
        - `tmIds` integer[], nullable
        - `dateFrom` string, date-time, nullable
        - `dateTo` string, date-time, nullable
        - `maxFileSize` integer, nullable
        - `minExamplesCount` integer, nullable
        - `maxExamplesCount` integer, nullable
      - `baseModel` string, nullable
      - `fineTunedModel` string, nullable
      - `trainedTokensCount` integer, nullable
      - `trainingDatasetUrl` string, nullable
      - `validationDatasetUrl` string, nullable
      - `metadata` object, nullable
        - `cost` number, float
        - `costCurrency` string
    - `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`: AI prompt with specified id was not found
- `405`: Method Not Allowed

---

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