Skip to main content

API Examples by Language

Shared placeholders

Use these values in all examples:

  • <base_url>
  • <api_key>
  • <history_item_id>
  • ./clothes.png
  • ./person.png

1) Get Available Tools (GET /generation/tools)

curl -X GET '<base_url>/generation/tools' \
-H 'Authorization: Bearer <api_key>'

Expected payload (example):

[
{ "group_tool": "fashion", "tool": "lego_clothes", "title": "Lego Clothes" },
{ "group_tool": "fashion", "tool": "mamasfit", "title": "MamasFit" },
{ "group_tool": "fashion", "tool": "lengerie", "title": "Lengerie" },
{ "group_tool": "fashion", "tool": "fashion_card", "title": "Fashion Card" },
{ "group_tool": "fashion", "tool": "fashion_swap", "title": "Fashion Swap" },
{ "group_tool": "fashion", "tool": "fashion_swap_half", "title": "Fashion Swap Half" },
{ "group_tool": "interior", "tool": "furniture", "title": "Furniture" },
{ "group_tool": "textile", "tool": "fabric", "title": "Fabric" },
{ "group_tool": "default", "tool": "default", "title": "Default" }
]

2) Get Generation Types (GET /generation/generationTypes)

curl -X GET '<base_url>/generation/generationTypes?tool=fashion_swap' \
-H 'Authorization: Bearer <api_key>'

3) Create Generation Job (POST /generation/generate_image_v2/)

curl -X POST '<base_url>/generation/generate_image_v2/' \
-H 'Authorization: Bearer <api_key>' \
-H 'Content-Type: multipart/form-data' \
-F 'tool=fashion_swap' \
-F 'clothes=@./clothes.png' \
-F 'person=@./person.png'

4) Check One Job (GET /user/generation-history/{id})

curl -X GET '<base_url>/user/generation-history/<history_item_id>' \
-H 'Authorization: Bearer <api_key>'

5) List History (GET /user/generation-history)

curl -X GET '<base_url>/user/generation-history?page=1&limit=20&status=complete&generation_type=<generation_type_id>' \
-H 'Authorization: Bearer <api_key>'

6) Send Feedback (PATCH /user/generation-history/feedback/{id})

curl -X PATCH '<base_url>/user/generation-history/feedback/<history_item_id>' \
-H 'Authorization: Bearer <api_key>' \
-H 'Content-Type: application/json' \
-d '{"like":true}'

7) Delete Record (DELETE /user/generation-history/{id})

curl -X DELETE '<base_url>/user/generation-history/<history_item_id>' \
-H 'Authorization: Bearer <api_key>'

Use http://localhost:8000/docs to verify exact payload requirements and response schemas in your current backend version.