---
title: "Train a model from a dataset"
method: POST
path: "/datasets/{dataset_id}/train_model"
tags: ["datasets"]
---

# Train a model from a dataset

`POST /datasets/{dataset_id}/train_model`

Start training a custom model from a dataset. The dataset must contain at least 15 images and a maximum of 100 images. Returns the model ID and training status.

## Path parameters

- `dataset_id` string, required

## Request body

- TrainDatasetModelRequest — Custom Model training request.
  - `model_name` string, required — Name for the trained model. Must be 5-30 characters, alphanumeric with spaces and hyphens allowed.

## Response `200`

Training started successfully

- TrainDatasetModelResponse
  - `model_id` string, required — Unique identifier of the created model.
  - `dataset_id` string, required — Identifier of the dataset used for training.
  - `training_status` string, required — Current training status of the model.
  - `model_name` string, required — Name of the model.

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Dataset not found

---

[API](https://skmtc.net/ideogram/apis/ideogram-openapi-3-0.md) · [All operations](https://skmtc.net/ideogram/apis/ideogram-openapi-3-0/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ideogram/ideogram-openapi-3-0/revisions/bd40f367a834/schema)
