---
title: "Create and train a Flux LoRA"
method: POST
path: "/v2/loras"
tags: ["LoRAs"]
---

# Create and train a Flux LoRA

`POST /v2/loras`

## Request

- Base URL: `https://api.apiframe.ai`
- URL: `https://api.apiframe.ai/v2/loras`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Multipart-form request with 15-30 training images plus metadata fields. Deducts 2 credits up-front (refunded on any subsequent failure) and queues a training job. The returned `id` becomes the `loraId` you pass to `flux-lora` inference.

## Response `202`

LoRA created and training queued.

- LoraCreated: Returned by `POST /v2/loras` once the upload has been spooled and training queued.
  - `id` string, uuid, required
  - `status` 'PENDING', required
  - `imageCount` integer, required

## Other responses

- `400`: Validation failed (bad metadata, unsupported file, or wrong number of images).
- `401`: Authentication failed (missing / invalid API key).
- `402`: Insufficient credits.
- `403`: Authenticated but the API key is inactive or lacks permission.
- `429`: Rate limit hit OR per-team in-flight training cap reached.
- `503`: Failed to enqueue training.

---

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