openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/ailabtools/hairstyle-changer-pro
info:
  title: Hairstyle Changer Pro
  version: 1.12.0
  description: Transform hairstyles and hair colors in images with the advanced,
    AI-powered Hairstyle Changer Pro API, offering a variety of styles and
    colors.
paths:
  /portrait/editing/hairstyle-pro:
    post:
      tags:
        - AI PORTRAIT > Portrait Editing
      summary: Hairstyle Changer Pro
      operationId: 051392b710af8015b0b67baf1b5d10e4
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              required:
                - task_type
                - image
                - hair_style
              properties:
                task_type:
                  description: "Task Type. <li>`async`: Asynchronous tasks.</li>"
                  type: string
                  enum:
                    - async
                  example: async
                image:
                  description: "<li>Image format: `PNG` `JPG` `JPEG`</li> <li>Image size: No more
                    than 3 MB.</li> <li>Image resolution: Larger than 200x200px,
                    smaller than 1999x1999px.</li> <li>Minimum Face Proportion:
                    To ensure effectiveness, the proportion of the face in the
                    image cannot be less than 20%.</li> <li>Facial Integrity: To
                    ensure effectiveness, the face in the image should ideally
                    not be obscured.</li> <li>Facial Angle: To ensure
                    effectiveness, the face in the image should ideally be
                    front-facing, with no more than a 45-degree rotation to the
                    left or right.</li>"
                  type: file
                hair_style:
                  description: "Men's Hairstyles: <li>`BuzzCut`: Buzz Cut hair</li>
                    <li>`UnderCut`: UnderCut hair</li> <li>`Pompadour`:
                    Pompadour hair</li> <li>`SlickBack`: Slick Back hair</li>
                    <li>`CurlyShag`: Curly Shag hair</li> <li>`WavyShag`: Wavy
                    Shag hair</li> <li>`FauxHawk`: Faux Hawk hair</li>
                    <li>`Spiky`: Spiky hair</li> <li>`CombOver`: Comb-over
                    hair</li> <li>`HighTightFade`: High and Tight Fade hair</li>
                    <li>`ManBun`: Man Bun hair</li> <li>`Afro`: Afro hair</li>
                    <li>`LowFade`: Low Fade hair</li> <li>`UndercutLongHair`:
                    Undercut With Long Hair</li> <li>`TwoBlockHaircut`: Two
                    Block Haircut</li> <li>`TexturedFringe`: Textured Fringe
                    Hair</li> <li>`BluntBowlCut`: Blunt Bowl Cut</li>
                    <li>`LongWavyCurtainBangs`: Long Wavy Curtain Bangs
                    Hair</li> <li>`MessyTousled`: Messy Tousled hair</li>
                    <li>`CornrowBraids`: Cornrow Braids hair</li>
                    <li>`LongHairTiedUp`: Long Hair Tied Up Hair</li>
                    <li>`Middle-parted`: Middle-parted Hair</li> Women's
                    Hairstyles: <li>`ShortPixieWithShavedSides`: Short Pixie
                    With Shaved Sides</li> <li>`ShortNeatBob`: short neat bob
                    hair</li> <li>`DoubleBun`: double bun hair</li> <li>`Updo`:
                    Updo hair</li> <li>`Spiked`: spiked hair</li> <li>`bowlCut`:
                    bowl cut hair</li> <li>`Chignon`: Chignon hair</li>
                    <li>`PixieCut`: Pixie Cut hair</li> <li>`SlickedBack`:
                    slicked back hair</li> <li>`LongCurly`: Long curly hair</li>
                    <li>`CurlyBob`: Curly bob hair</li>
                    <li>`StackedCurlsInShortBob`: Stacked Curls in Short Bob
                    hair</li> <li>`SidePartCombOverHairstyleWithHighFade`: Side
                    Part Comb-Over Hairstyle With High Fade hair</li>
                    <li>`WavyFrenchBobVibesfrom1920`: Wavy French Bob Vibes from
                    1920</li> <li>`BobCut`: bob Haircut hair</li>
                    <li>`ShortTwintails`: Short Twintails hair</li>
                    <li>`ShortCurlyPixie`: Short Curly Pixie</li>
                    <li>`LongStraight`: Long straight hair</li> <li>`LongWavy`:
                    Long wavy hair</li> <li>`FishtailBraid`: Fishtail braid
                    hair</li> <li>`TwinBraids`: Twin Braids hair</li>
                    <li>`Ponytail`: Ponytail hair</li> <li>`Dreadlocks`:
                    dreadlocks hair</li> <li>`Cornrows`: Cornrows hair</li>
                    <li>`ShoulderLengthHair`: Shoulder Length Straight Hair</li>
                    <li>`LooseCurlyAfro`: Loose Curly Afro hair</li>
                    <li>`LongTwintails`: Long Twintails hair</li>
                    <li>`LongHimeCut`: Long Hime Cut hair</li> <li>`BoxBraids`:
                    Box Braids hair</li>"
                  type: string
                  enum:
                    - BuzzCut
                    - UnderCut
                    - Pompadour
                    - SlickBack
                    - CurlyShag
                    - WavyShag
                    - FauxHawk
                    - Spiky
                    - CombOver
                    - HighTightFade
                    - ManBun
                    - Afro
                    - LowFade
                    - UndercutLongHair
                    - TwoBlockHaircut
                    - TexturedFringe
                    - BluntBowlCut
                    - LongWavyCurtainBangs
                    - MessyTousled
                    - CornrowBraids
                    - LongHairTiedUp
                    - Middle-parted
                    - ShortPixieWithShavedSides
                    - ShortNeatBob
                    - DoubleBun
                    - Updo
                    - Spiked
                    - bowlCut
                    - Chignon
                    - PixieCut
                    - SlickedBack
                    - LongCurly
                    - CurlyBob
                    - StackedCurlsInShortBob
                    - SidePartCombOverHairstyleWithHighFade
                    - WavyFrenchBobVibesfrom1920
                    - BobCut
                    - ShortTwintails
                    - ShortCurlyPixie
                    - LongStraight
                    - LongWavy
                    - FishtailBraid
                    - TwinBraids
                    - Ponytail
                    - Dreadlocks
                    - Cornrows
                    - ShoulderLengthHair
                    - LooseCurlyAfro
                    - LongTwintails
                    - LongHimeCut
                    - BoxBraid
                color:
                  description: "Color. <li>`blonde`: blonde hair</li> <li>`platinumBlonde`:
                    platinum blonde hair</li> <li>`brown`: brown hair</li>
                    <li>`lightBrown`: light brown hair</li> <li>`blue`: blue
                    hair</li> <li>`lightBlue`: light blue hair</li>
                    <li>`purple`: purple hair</li> <li>`lightPurple`: light
                    purple hair</li> <li>`pink`: pink hair</li> <li>`black`:
                    black hair</li> <li>`white`: white hair</li> <li>`grey`:
                    grey hair</li> <li>`silver`: silver hair</li> <li>`red`: red
                    hair</li> <li>`orange`: orange hair</li> <li>`green`: green
                    hair</li> <li>`gradient`: gradient hair</li>
                    <li>`multicolored`: multicolored hair</li> <li>`darkBlue`:
                    blue hair</li> <li>`burgundy`: burgundy hair</li>
                    <li>`darkGreen`: dark green</li>"
                  type: string
                  enum:
                    - blonde
                    - platinumBlonde
                    - brown
                    - lightBrown
                    - blue
                    - lightBlue
                    - purple
                    - lightPurple
                    - pink
                    - black
                    - white
                    - grey
                    - silver
                    - red
                    - orange
                    - green
                    - gradient
                    - multicolored
                    - darkBlue
                    - burgundy
                    - darkGreen
                image_size:
                  description: Returns the number of images.
                  type: integer
                  default: 1
                  enum:
                    - 1
                    - 2
                    - 3
                    - 4
              type: object
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                allOf:
                  - properties:
                      task_type:
                        description: "Task Type. <li>`async`: Asynchronous tasks.</li>"
                        type: string
                        enum:
                          - async
                        example: async
                      task_id:
                        description: Asynchronous task ID.
                        type: string
                    type: object
                  - $ref: "#components/schemas/commonResponses"
        "400":
          description: Bad Request
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "405":
          description: Method Not Allowed
        "409":
          description: Conflict
        "410":
          description: Gone
        "413":
          description: Payload Too Large
        "415":
          description: Unsupported Media Type
        "422":
          description: Unprocessable Entity
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
        "503":
          description: Service Unavailable
        "504":
          description: Gateway Timeout
    parameters:
      - &a1
        description: API.market API Key
        in: header
        name: x-api-market-key
        value: Please Login/Signup to get an API Key
        required: true
        schema:
          type: string
  /api/apimarket/query-async-task-result:
    get:
      tags:
        - AI COMMON
      summary: Retrieving Asynchronous Task Results
      parameters:
        - name: task_id
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                allOf:
                  - properties:
                      task_status:
                        description: "Asynchronous task status. <li>`0`: The task is queued.</li>
                          <li>`1`: Asynchronous processing.</li> <li>`2`:
                          Processing was successful.</li>"
                        type: integer
                        enum:
                          - 0
                          - 1
                          - 2
                      data:
                        description: The content of the result data returned.
                        type: object
                        allOf:
                          - properties:
                              images:
                                description: "Result URL address. `Expiration: 24 hours.`"
                                type: array
                                items:
                                  type: string
                            type: object
                    type: object
                  - $ref: "#components/schemas/commonResponses"
        "400":
          description: Bad Request
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
        "405":
          description: Method Not Allowed
        "409":
          description: Conflict
        "410":
          description: Gone
        "413":
          description: Payload Too Large
        "415":
          description: Unsupported Media Type
        "422":
          description: Unprocessable Entity
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
        "503":
          description: Service Unavailable
        "504":
          description: Gateway Timeout
    parameters:
      - *a1
components:
  schemas:
    commonResponses:
      properties:
        request_id:
          description: Request ID. <li>If there is a problem that cannot be located, this
            field can be sent to technology for problem location.</li>
          type: string
        log_id:
          description: Log ID. <li>If there is a problem that cannot be located, this
            field can be sent to technology for problem location.</li>
          type: string
        error_code:
          description: "Status code. <li>When HTTP Status is 200: error_code=0; otherwise
            exactly the same as HTTP Status.</li>"
          type: integer
        error_detail:
          type: object
          allOf:
            - properties:
                status_code:
                  description: Status Code.
                  type: integer
                code:
                  description: Error Code.
                  type: string
                code_message:
                  description: The information represented by the Error Code(`code`).
                  type: string
                message:
                  description: Supplementary information for the `code_message` field.
                  type: string
              type: object
        error_msg:
          description: Error message.
          type: string
      type: object
security: {}
tags:
  - name: face-tools
    description: Operations related to face-tools
  - name: background-removal
    description: Operations related to background-removal
  - name: image-upscaling
    description: Operations related to image-upscaling
