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

# Model Training

> Create custom models — style, object, person, or setting — from reference images.

Create a custom model in one of four categories — `style`, `object`, `person`, or
`setting` — from 1–10 reference images. Once `completed`, the model can be composed
into [image generation](/api-reference/images/generate),
[Magic Edit](/api-reference/edits/create), and
[styled video](/api-reference/videos/generate).

## Two ways to submit reference images

* **Inline** — [`POST /models`](/api-reference/model-training/create) with each
  image as an `https` `url` or inline `base64` + `mime_type`. Simplest for small
  images and remote URLs.
* **Presigned upload** — for large files, call
  [`POST /models/prepare`](/api-reference/model-training/prepare) to get presigned
  PUT URLs, `PUT` each file, then
  [`POST /models/{id}/complete`](/api-reference/model-training/complete) to start
  processing.

Both paths require the `models.write` scope.

## Asynchronous pattern

Creation returns **`202 Accepted`** with a model `id` and an `estimated_credits`
figure; poll [`GET /models/{id}/status`](/api-reference/model-training/status) until
`status` is `completed` (or `failed`). A `webhook_url` gives you a push callback —
see [Webhooks](/guides/webhooks). Credits draw from your organization's pool; an
exhausted pool returns `402`. See [Pricing](/guides/pricing).
