fashn-logo
FASHNAI

API Endpoints

On this page you will find our HTTP API reference. Currently, we support 2 types of endpoints:

Run prediction

Initiate a new try-on prediction by posting to the following endpoint:

POSThttps://api.fashn.ai/v1/run

Request

curl -X POST https://api.fashn.ai/v1/run \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_API_KEY_HERE" \
     -d '{
           "model_name": "tryon-v1.6",
           "inputs": {
             "model_image": "http://example.com/path/to/model.jpg",
             "garment_image": "http://example.com/path/to/garment.jpg"
           }
         }'

Top-level Properties

model_name
Required
'tryon-v1.6' | 'tryon-v1.5'

Specifies the model version to use for the virtual try-on prediction.

  • tryon-v1.6 - The latest and most advanced model, producing higher-quality outputs at 864×1296 resolution.
  • tryon-v1.5 - The previous stable release, generating outputs at 576×864 resolution. Slightly faster than v1.6.

inputs
Required
object

Contains all the input parameters for the selected model. See the expandable sections below for version-specific parameters.

Backwards Compatibility Note

For a temporary transition period, if you send a request using the old format (parameters directly in the request body without model_name and inputs), the API will automatically use tryon-v1.5 for backwards compatibility.

Input Parameters

The following parameters are nested within the inputs object. Select a model version to view its available parameters:

Response

The reponse will return the id of the prediction which you will need to use for getting the status and result.

{
  "id": "123a87r9-4129-4bb3-be18-9c9fb5bd7fc1-u1",
  "error": null
}

Get prediction status

Receive the status of the prediction by id. Unless in a queue, it takes up to 40 seconds to generate a try-on.

GEThttps://api.fashn.ai/v1/status/:id

Poll this endpoint to monitor the prediction's progress and retrieve the final output once available.

Request

curl -X GET https://api.fashn.ai/v1/status/123a87r9-4129-4bb3-be18-9c9fb5bd7fc1-u1 \
     -H "Authorization: Bearer YOUR_API_KEY_HERE"

Response

The response will return the prediction id and status.

Status types can be one of the following:

statusstarting | in_queue | processing | completed | failed

Prediction in progress

{
  "id": "123a87r9-4129-4bb3-be18-9c9fb5bd7fc1-u1",
  "status": "processing",
  "error": null
}

Prediction completed

{
  "id": "123a87r9-4129-4bb3-be18-9c9fb5bd7fc1-u1",
  "status": "completed",
  "output": [
    "https://cdn.staging.fashn.ai/123a87r9-4129-4bb3-be18-9c9fb5bd7fc1-u1/output_0.png"
  ],
  "error": null
}

Rate Limits

  • /run - Up to 50 requests per 60 seconds
  • /status - Up to 50 requests per 10 seconds
Rate Limit Adjustments

Our API rate limits are in place to ensure fair usage and prevent misuse of our services. However, we understand that legitimate applications may require higher limits as they grow. If your app's usage nears the specified rate limits, and this usage is justified by your application's needs, we will gladly increase your rate limit. Please reach out to our support@fashn.ai to discuss your specific requirements.

Privacy

Inputs and outputs generated through the API will be automatically deleted from our systems after 72 hours. However, you can still view the requests via the web app interface.

On this page