Flux LoRA Trainer API: Training

Use Flux LoRA Trainer with Flux LoRA Trainer via the Muapi REST API. Pay per generation — no subscription needed.

Flux LoRA Trainer API Reference

Endpoint

POST https://api.muapi.ai/api/v1/flux-lora-trainer

Submit a job with your MuApi API key in the x-api-key header, then poll https://api.muapi.ai/api/v1/predictions/{request_id}/result until status is completed.

Parameters

NameTypeRequiredDescription
images_data_urlstringYesPublic URL to a .zip archive containing 10-50 training images. Optional caption .txt files (same name as the matching image) can include a [trigger] placeholder which is replaced with trigger_phrase.
trigger_phrasestringNoA unique word or short phrase that activates the trained concept at inference time. Keep it short and unusual so it does not collide with normal vocabulary.
training_stylestringNoWhat the LoRA learns: 'subject' (a person, character, or object) or 'style' (an aesthetic or art direction).Options: subject, styleDefault: "subject"

cURL example

REQUEST_ID=$(curl -s -X POST https://api.muapi.ai/api/v1/flux-lora-trainer \
  -H "x-api-key: $MUAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"images_data_url":"https://example.com/your-images_data_url"}' | jq -r .request_id)

curl -s https://api.muapi.ai/api/v1/predictions/$REQUEST_ID/result -H "x-api-key: $MUAPI_API_KEY"

Python example

import os, time, requests

API = "https://api.muapi.ai/api/v1"
headers = {"x-api-key": os.environ["MUAPI_API_KEY"]}

r = requests.post(f"{API}/flux-lora-trainer", headers=headers, json={"images_data_url":"https://example.com/your-images_data_url"})
request_id = r.json()["request_id"]

while True:
    res = requests.get(f"{API}/predictions/{request_id}/result", headers=headers).json()
    if res["status"] == "completed":
        print(res["outputs"]); break
    if res["status"] == "failed":
        raise RuntimeError(res.get("error"))
    time.sleep(3)

Full docs and agent/MCP integration: llms.txt. Get an API key at muapi.ai/access-keys.