API References

API Reference

This page provides the complete technical reference for all Mirrago API endpoints.
Mirrago exposes a minimal surface area --- only the endpoints required to authenticate, generate try-on jobs, and retrieve results.


Base URL

All requests are made to:

https://api.mirrago.com

Authentication

All protected endpoints require an access token in the request header:

Authorization: Bearer <access_token>

Access tokens are obtained using the OAuth client-credentials flow.


POST /oauth/token

Generates an access token using your API credentials.

Request Body

{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET",
  "grant_type": "client_credentials"
}

Response

{
  "access_token": "eyJhbGci...",
  "expires_in": 3600,
  "token_type": "Bearer"
}

Try-On APIs

POST /v1/mirrago/generate-image

Creates a new try-on generation job.

Request Headers

Authorization: Bearer <access_token>
Content-Type: application/json

Content Type

multipart/form-data

Form Data Fields

Field Name Type Required Description
target_image file Yes Model image file (jpg/png)
garment_image file Yes Garment image file (jpg/png)
target_image_url file Yes Model image file (jpg/png)
garment_image_url file Yes Garment image file (jpg/png)
background string No Background preference
username string No Requesting user reference

Request Body

{
  "target_image": "https://cdn.yourbrand.com/models/model.jpg",
  "garment_image": "https://cdn.yourbrand.com/garments/shirt.png",
  "callback_url": "https://optional.yourapp.com/webhook",
	"backgroud": false
}

Request Body With Url

{
  "target_image_url": "https://cdn.yourbrand.com/models/model.jpg",
  "garment_image_url": "https://cdn.yourbrand.com/garments/shirt.png",
	"backgroud": false
}

Response

{
     "job_id": "82cd18eb-fd80-4292-9c40-3c31e739604c",
     "status": "pending",
     "business_id": "nike",
     "username": "TEMP2c9eaf7f-3fcd-4041-9eab-ed6dbaa58b53",
     "cloth_id": "business/nike/clothes/6dae61c8-e73f-4799-bde0-4b17c62c1853.jpeg",
     "credits_before": 100,
     "created_at": "2026-01-24T13:07:14.211044"
}

GET /v1/mirrago/job/{job_id}

Retrieves job progress and final try-on image.

Request Header

Authorization: Bearer <access_token>

Response --- Processing

{
     "job_id": "82cd18eb-fd80-4292-9c40-3c31e739604c",
     "cloth_id": "business/nike/clothes/6dae61c8-e73f-4799-bde0-4b17c62c1853.jpeg",
     "cloth_img_url": "",
     "status": "queued",
     "created_at": "2026-01-24T13:07:14.096542",
     "generated_image_key": "",
     "result_url": null,
     "error_msg": {}

Response --- Completed

{
   "job_id": "82cd18eb-fd80-4292-9c40-3c31e739604c",
	 "cloth_id": "business/nike/clothes/6dae61c8-e73f-4799-bde0-4b17c62c1853.jpeg",
	 "cloth_img_url": "",
	 "status": "completedc",
	 "created_at": "2026-01-24T13:07:14.096542",
	 "generated_image_key": "/testimage.png",
	 "result_url": "https://testimage.png",
	 "error_msg": {}
}

Response --- Failed

{
   "job_id": "82cd18eb-fd80-4292-9c40-3c31e739604c",
	 "cloth_id": "business/nike/clothes/6dae61c8-e73f-4799-bde0-4b17c62c1853.jpeg",
	 "cloth_img_url": "",
	 "status": "failed",
	 "created_at": "2026-01-24T13:07:14.096542",
	 "generated_image_key": "",
	 "result_url": "",
	 "error_msg": {"error": "something went wrong"}
}

Error Handling

HTTP Status Meaning Description


400 Bad Request Invalid image URL 401 Unauthorized Missing or invalid token 500 Rate Limit Too many requests 500 Server Error Processing failure