Skip to content

V2.0

Generate virtual try-on experiences for hats from uploaded images using AI processing, supporting gender-specific style parameters.

Run an AI Hat task.

Request

This endpoint initiates the hat virtual try-on process. You must provide a source file, reference files (URL or ID), specify gender and style parameters. The task will be processed asynchronously, and you can check its status using the task_id returned in this response.

Security
BearerAuthenticationV2
Bodyapplication/jsonrequired
Any of:
genderstringrequired

Gender of the person in the image.

Enum:"female""male"
Example:"female"
stylestring

To control outfit and background style.

Default:"random"
Enum:"random""style_sporty_casual""style_urban_fashion""style_vacation_casual""style_warm_cozy""style_bohemian"
Example:"random"
src_file_urlstringrequired

Url of the file to run task. The url should be publicly accessible.

Example:"https://example.com/selfie.jpg"
ref_file_urlstringrequired

Url of the reference file to run task. The url should be publicly accessible.

Example:"https://example.com/accessory.jpg"
POST
/s2s/v2.0/task/hat
curl -i -X POST \
  https://yce-api-01.makeupar.com/s2s/v2.0/task/hat \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "src_file_url": "https://example.com/selfie.jpg",
    "ref_file_url": "https://example.com/accessory.jpg",
    "gender": "female",
    "style": "random"
  }'

Responses

Successful execution of the task

Bodyapplication/json
statusinteger

Response status

Example:200
dataobject
Response
{ "status": 200, "data": { "task_id": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe" } }