Flair AI Custom Model API (1.0.0)

Download OpenAPI specification:Download

API for managing custom AI models, training data, training jobs and predictions.

This API allows you to:

  • Create and manage custom AI models
  • Upload training data (images)
  • Train models on your data
  • Generate predictions using trained models

Authentication is done via an API key that must be included in the header of all requests.

Create a new custom model

Creates a new custom model that can be trained on your data.

Example use case: Creating a model to generate images of clothing items in your brand's style.

Authorizations:
ApiKeyAuth
Request Body schema: application/json
required
displayName
string

Human-readable name for the model (e.g. "Summer Collection Style Model")

customModelType
string

Type of custom model (reserved for future use)

Responses

Request samples

Content type
application/json
{
  • "displayName": "Summer Collection Style Model"
}

Response samples

Content type
application/json
{
  • "id": "abc123",
  • "displayName": "Summer Collection Style Model"
}

List all models

Retrieves a list of all custom models accessible to the authenticated user.

Example use case: Getting an overview of all your brand's style models.

Authorizations:
ApiKeyAuth
query Parameters
lastDocId
string

ID of the last document from previous page for pagination

Responses

Response samples

Content type
application/json
{
  • "models": [
    ],
  • "nextPageCursor": "abc123",
  • "hasMore": true
}

Get model details by ID

Retrieves details about a specific custom model.

Example use case: Checking the name of your clothing style model.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

Responses

Response samples

Content type
application/json
{
  • "displayName": "Summer Collection Style Model"
}

Update model display name

Updates the display name of an existing model.

Example use case: Renaming your clothing style model to be more specific.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

Request Body schema: application/json
required
updatedDisplayName
string

New display name for the model

Responses

Request samples

Content type
application/json
{
  • "updatedDisplayName": "Summer Dresses Style Model"
}

Delete model (soft-delete)

Marks a model as deleted without physically removing it. This preserves the model's history and associated predictions.

Example use case: Removing an old clothing style model you no longer need.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

Responses

Upload data item for model

Uploads a single image to use as training data for the model.

Supported formats: webp, png, jpeg, jpg Maximum file size: 10MB

Example use case: Uploading photos of dresses in your brand's style to train the model.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

Request Body schema: application/octet-stream
required
string <binary>

Raw binary image data

Responses

Response samples

Content type
application/json
{
  • "dataId": "xyz789"
}

List all data items for model

Retrieves a list of all training images uploaded for a specific model.

Example use case: Reviewing all the dress photos you've uploaded for training.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

query Parameters
lastDocId
string

ID of the last document from previous page for pagination

Responses

Response samples

Content type
application/json
{}

Get data item details

Retrieves details about a specific training image, including the image data.

Example use case: Retrieving a specific dress photo you uploaded for training.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

dataId
required
string
Example: xyz789

Unique identifier of the data item

Responses

Response samples

Content type
application/json

Update data item

Replaces an existing training image with a new one.

Example use case: Replacing a low-quality dress photo with a better one.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

dataId
required
string
Example: xyz789

Unique identifier of the data item

Request Body schema: application/octet-stream
required
string <binary>

New image data

Responses

Delete data item

Permanently removes a training image from the model.

Example use case: Removing a dress photo that doesn't match your brand's style.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

dataId
required
string
Example: xyz789

Unique identifier of the data item

Responses

Start model training

Initiates a training job for the model using uploaded training images.

The trainingStrength parameter determines the extent to which the model aligns with the dataset content. Stronger = closer to dataset.

Two training modes are available:

  • fast: Several minutes
  • high_quality: A few hours of training at most.

Example use case: Training your model to generate images in your brand's dress style.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

Request Body schema: application/json
required
trainingStrength
integer [ 0 .. 10 ]

How strongly the model should learn from your training data

trainingSpeed
string
Default: "high_quality"
Enum: "fast" "high_quality"

Training mode - fast expected to take several minutes, high_quality a few hours at most

trainingStyle
string
Enum: "content" "style" "balanced"

For high_quality mode only - what aspects of the training data to learn from

isStyle
boolean

For fast mode only - whether to learn style (true) or content (false)

isInputFormatAlreadyPreprocessed
boolean

For fast mode only - whether input images are pre-processed

Responses

Request samples

Content type
application/json
{
  • "trainingStrength": 7,
  • "trainingSpeed": "high_quality",
  • "trainingStyle": "balanced"
}

Response samples

Content type
application/json
{
  • "trainingId": "def456"
}

List all training jobs for model

Retrieves a list of all training jobs for a specific model.

Example use case: Checking the history of training attempts for your dress style model.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

query Parameters
lastDocId
string

ID of the last document from previous page for pagination

Responses

Response samples

Content type
application/json
{
  • "trainings": [
    ],
  • "nextPageCursor": "def457",
  • "hasMore": true
}

Get training job status

Checks the current status of a specific training job.

Example use case: Monitoring the progress of your dress style model training.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

trainingId
required
string
Example: def456

Unique identifier of the training job

Responses

Response samples

Content type
application/json
{
  • "status": "processing",
  • "triggerWord": "FJA90AB"
}

Cancel training job

Attempts to cancel an in-progress training job. Note that:

  • Cancellation is not guaranteed to succeed
  • You will be charged for partially completed training
  • Already completed or failed jobs cannot be canceled

Example use case: Stopping a training job that's using incorrect parameters.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

trainingId
required
string
Example: def456

Unique identifier of the training job

Responses

Delete training job record

Marks a training job as deleted without actually canceling it. This is a soft-delete that preserves the training history.

Example use case: Cleaning up old training records while preserving the trained model.

Authorizations:
ApiKeyAuth
path Parameters
modelId
required
string
Example: abc123

Unique identifier of the model

trainingId
required
string
Example: def456

Unique identifier of the training job

Responses

Create prediction

Generates new images using your trained model(s).

Example use case: Generating new dress designs in your brand's style.

You can combine multiple trained models by specifying their weights in scaleConfigs.

Authorizations:
ApiKeyAuth
Request Body schema: application/json
required
object

Configuration for which models to use and their weights

prompt
string

Text description of the image to generate. Must include trigger word for custom model in order to activate it.

seed
integer

Random seed for reproducible results

object

Dimensions of generated images (width and height between 512-1536)

num_images
integer [ 1 .. 4 ]

Number of images to generate (1-4)

guidance_scale
number [ 0 .. 10 ]

How closely to follow the prompt (0.0-10.0)

num_inference_steps
integer [ 1 .. 50 ]

Number of denoising steps (1-50)

Responses

Request samples

Content type
application/json
{
  • "scaleConfigs": {
    },
  • "prompt": "A summer dress with floral pattern in style of FJA90AB",
  • "image_size": {
    },
  • "num_images": 4,
  • "guidance_scale": 7.5,
  • "num_inference_steps": 50
}

Response samples

Content type
application/json
{
  • "predictionId": "ghi789"
}

List all predictions

Retrieves a list of all predictions made by the authenticated user.

Example use case: Reviewing all your generated dress designs.

Authorizations:
ApiKeyAuth
query Parameters
lastDocId
string

ID of the last document from previous page for pagination

Responses

Response samples

Content type
application/json
{}

Get prediction status and results

Retrieves the current status and generated images (if available) for a specific prediction.

Example use case: Checking if your dress designs have been generated and downloading them.

Authorizations:
ApiKeyAuth
path Parameters
predictionId
required
string
Example: ghi789

Unique identifier of the prediction

Responses

Response samples

Content type
application/json

Delete prediction record

Marks a prediction as deleted. This is a soft-delete that preserves the prediction history.

Example use case: Removing old or unsuccessful dress design generations from your list.

Authorizations:
ApiKeyAuth
path Parameters
predictionId
required
string
Example: ghi789

Unique identifier of the prediction

Responses