> ## Documentation Index
> Fetch the complete documentation index at: https://ailabtools.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Face Beauty Pro Async API

> Face Beauty Pro API provides advanced portrait retouching, face shaping, eyebrow removal, filters, and skin beautification.

## Request

* **URL**: `https://www.ailabapi.com/api/portrait/effects/face-beauty-pro`
* **Method**: `POST`
* **Content-Type**: `multipart/form-data`

### Image requirements

* **Image format**: `JPEG` `JPG` `PNG`
* **Image size**: No more than 2 MB.
* **Image resolution**: Larger than 48x48px, smaller than 4096x4096px.

### Headers

| Field              | Required | Type     | Description                                           |
| :----------------- | :------- | :------- | :---------------------------------------------------- |
| `ailabapi-api-key` | YES      | `string` | Application API KEY. [Get API KEY](/docs/get-api-key) |

### Body

| Field            | Required | Type      | Scope                                                                                                                                                                                                   | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| :--------------- | :------- | :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `task_type`      | YES      | `string`  | `async`                                                                                                                                                                                                 |         | \`\`async`: Asynchronous tasks.`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `image`          | YES      | `file`    |                                                                                                                                                                                                         |         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `whitening`      | NO       | `integer` | \[0, 100]                                                                                                                                                                                               | `50`    | Whitening Degree. `0` means no whitening effect, `100` represents the highest degree.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `smoothing`      | NO       | `integer` | \[0, 100]                                                                                                                                                                                               | `50`    | Smoothing Degree. `0` means no smoothing effect, `100` represents the highest degree.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `thinface`       | NO       | `integer` | \[0, 100]                                                                                                                                                                                               | `50`    | Face Slimming Degree. `0` means no face slimming effect, `100` represents the highest degree.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `shrink_face`    | NO       | `integer` | \[0, 100]                                                                                                                                                                                               | `50`    | Small Face Degree. `0` means no small face effect, `100` represents the highest degree.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `enlarge_eye`    | NO       | `integer` | \[0, 100]                                                                                                                                                                                               | `50`    | Big Eyes Degree. `0` means no big eyes effect, `100` represents the highest degree.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `remove_eyebrow` | NO       | `integer` | \[0, 100]                                                                                                                                                                                               | `50`    | Eyebrow Removal Degree. `0` means no eyebrow removal effect, `100` represents the highest degree.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `filter_type`    | NO       | `integer` | `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `13`, `14`, `15`, `16`, `17`, `18`, `19`, `20`, `21`, `22`, `23`, `24`, `25`, `26`, `27`, `28`, `29`, `30`, `31`, `32`, `33`, `34`, `35` |         | ``1`: Black and White.`, ``2`: Calm.`, ``3`: Sunny Day.`, ``4`: Journey.`, ``5`: Beautify Skin.`, ``6`: Hong Kong Style.`, ``7`: Aesthetic.`, ``8`: Lovely.`, ``9`: New York.`, ``10`: Sakura.`, ``11`: Seventeen.`, ``12`: Soft Light.`, ``13`: Afternoon Tea.`, ``14`: Brighten Skin.`, ``15`: Chaplin.`, ``16`: Floral.`, ``17`: Memories.`, ``18`: Ice Beauty.`, ``19`: Paris.`, ``20`: Time.`, ``21`: LOMO.`, ``22`: Old Times.`, ``23`: Early Spring.`, ``24`: Story.`, ``25`: Abao Color.`, ``26`: Fill Light.`, ``27`: Warm.`, ``28`: Gorgeous.`, ``29`: Lavender.`, ``30`: Chanel.`, ``31`: Prague.`, ``32`: Old Dreams.`, ``33`: Peach Blossom.`, ``34`: Pink.`, \`\`35`: Misty Rain.` |

## Response

<Warning>
  **Response Field Handling Flow**

  1. **Handle `Public Response Fields`**

     Parse and validate the `Public Response Fields`, checking the status code or response message to ensure the request is successful and error-free.

  2. **Handle `Business Response Fields`**

     If the `Public Response Fields` are valid and error-free, proceed with processing the business logic in the `Business Response Fields`.
</Warning>

### Public Response Fields

<a href="/docs/response-description" target="_blank">Viewing Public Response Fields and Error Codes</a>

### Business Response Fields

| Field       | Type     | Scope   | Description                                 |
| :---------- | :------- | :------ | :------------------------------------------ |
| `task_type` | `string` | `async` | Task Type. \`\`async`: Asynchronous tasks.` |
| `task_id`   | `string` |         | Asynchronous task ID.                       |

### Response Example

```json theme={null}
{
  "request_id":     "",
  "log_id":         "",
  "error_code":     0,
  "error_msg":      "",
  "error_detail":   {
    "status_code":  200,
    "code":         "",
    "code_message": "",
    "message":      ""
  },
  "task_type":      "",
  "task_id":        ""
}
```

<Tip>
  This API is asynchronous, please keep `task_id` and call [`Querying Async Task Results`](/docs/ai-common/async-task-results/api) to get the final results.

  Asynchronous task results are valid for 24 hours. It is recommended that asynchronous task results be queried every 5 seconds.
</Tip>

## `Querying Async Task Results` Response

<Warning>
  **Response Field Handling Flow**

  1. **Handle `Public Response Fields`**

     Parse and validate the `Public Response Fields`, checking the status code or response message to ensure the request is successful and error-free.

  2. **Handle `Business Response Fields`**

     If the `Public Response Fields` are valid and error-free, proceed with processing the business logic in the `Business Response Fields`.
</Warning>

### Public Response Fields

<a href="/docs/response-description" target="_blank">Viewing Public Response Fields and Error Codes</a>

### Business Response Fields

| Field         | Type      | Scope         | Description                                                                                                              |
| :------------ | :-------- | :------------ | :----------------------------------------------------------------------------------------------------------------------- |
| `task_status` | `integer` | `0`, `1`, `2` | Asynchronous task status. ``0`: The task is queued.` ``1`: Asynchronous processing.` \`\`2`: Processing was successful.` |
| `result_url`  | `string`  |               | Result URL address.                                                                                                      |

<Tip>
  The URL address is a temporary address, valid for 24 hours, and will not be accessible after it expires. If you need to save the file for a long time or permanently, please visit the URL address within 24 hours and download the file to your own storage space.
</Tip>

### Response Example

```json theme={null}
{
  "error_code":     0,
  "error_msg":      "",
  "error_detail":   {
    "status_code":  200,
    "code":         "",
    "code_message": "",
    "message":      ""
  },
  "task_status":    0,
  "result_url":     ""
}
```


## OpenAPI

````yaml POST /api/portrait/effects/face-beauty-pro
openapi: 3.0.0
info:
  title: AILabAPI
  description: >-
    [<b>AILabTools</b>](https://www.ailabtools.com) is an advanced tool that
    offers a vast array of simple and flexible API endpoints to suit your
    specific needs. With just one [<b>API
    KEY</b>](https://www.ailabtools.com/doc/get-api-key), you can easily call
    any of the endpoints and integrate them quickly into your application or
    workflow, allowing for smooth and efficient operations.


    [<b>AILabTools</b>](https://www.ailabtools.com) is continuously evolving,
    and you can anticipate even more API endpoints being added in the future,
    further enhancing its capabilities and usefulness for your artificial
    intelligence and machine learning requirements.
  version: 1.0.0
servers:
  - url: https://www.ailabapi.com
    description: Production server
security:
  - apiKeyAuth: []
tags:
  - name: AI IMAGE
  - name: AI IMAGE > Image Enhancement
  - name: AI IMAGE > Image Effects
  - name: AI IMAGE > Image Editing
  - name: AI IMAGE > Image Scoring
  - name: AI BACKGROUND REMOVAL
  - name: AI BACKGROUND REMOVAL > Portrait
  - name: AI BACKGROUND REMOVAL > General
  - name: AI PORTRAIT
  - name: AI PORTRAIT > Portrait Effects
  - name: AI PORTRAIT > Portrait Enhance
  - name: AI PORTRAIT > Portrait Editing
  - name: AI PORTRAIT > Portrait Analysis
  - name: AI COMMON
paths:
  /api/portrait/effects/face-beauty-pro:
    post:
      tags:
        - AI PORTRAIT > Portrait Effects
      summary: Face Beauty Pro
      description: >-
        Face Beauty Pro API provides advanced portrait retouching, face shaping,
        eyebrow removal, filters, and skin beautification.
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                task_type:
                  type: string
                  description: >-
                    Task Type. <li>`sync`: Synchronous tasks.</li> <li>`async`:
                    Asynchronous tasks.</li>
                  example: sync
                image:
                  type: string
                  format: binary
                whitening:
                  type: integer
                  description: >-
                    Whitening Degree. `0` means no whitening effect, `100`
                    represents the highest degree.
                  example: '50'
                smoothing:
                  type: integer
                  description: >-
                    Smoothing Degree. `0` means no smoothing effect, `100`
                    represents the highest degree.
                  example: '50'
                thinface:
                  type: integer
                  description: >-
                    Face Slimming Degree. `0` means no face slimming effect,
                    `100` represents the highest degree.
                  example: '50'
                shrink_face:
                  type: integer
                  description: >-
                    Small Face Degree. `0` means no small face effect, `100`
                    represents the highest degree.
                  example: '50'
                enlarge_eye:
                  type: integer
                  description: >-
                    Big Eyes Degree. `0` means no big eyes effect, `100`
                    represents the highest degree.
                  example: '50'
                remove_eyebrow:
                  type: integer
                  description: >-
                    Eyebrow Removal Degree. `0` means no eyebrow removal effect,
                    `100` represents the highest degree.
                  example: '50'
                filter_type:
                  type: string
                  description: >-
                    Filter Effects. <li>`1`: Black and White.</li> <li>`2`:
                    Calm.</li> <li>`3`: Sunny Day.</li> <li>`4`: Journey.</li>
                    <li>`5`: Beautify Skin.</li> <li>`6`: Hong Kong Style.</li>
                    <li>`7`: Aesthetic.</li> <li>`8`: Lovely.</li> <li>`9`: New
                    York.</li> <li>`10`: Sakura.</li> <li>`11`: Seventeen.</li>
                    <li>`12`: Soft Light.</li> <li>`13`: Afternoon Tea.</li>
                    <li>`14`: Brighten Skin.</li> <li>`15`: Chaplin.</li>
                    <li>`16`: Floral.</li> <li>`17`: Memories.</li> <li>`18`:
                    Ice Beauty.</li> <li>`19`: Paris.</li> <li>`20`: Time.</li>
                    <li>`21`: LOMO.</li> <li>`22`: Old Times.</li> <li>`23`:
                    Early Spring.</li> <li>`24`: Story.</li> <li>`25`: Abao
                    Color.</li> <li>`26`: Fill Light.</li> <li>`27`: Warm.</li>
                    <li>`28`: Gorgeous.</li> <li>`29`: Lavender.</li> <li>`30`:
                    Chanel.</li> <li>`31`: Prague.</li> <li>`32`: Old
                    Dreams.</li> <li>`33`: Peach Blossom.</li> <li>`34`:
                    Pink.</li> <li>`35`: Misty Rain.</li>
      responses:
        '200':
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              examples:
                example-0:
                  summary: Sync
                  value:
                    request_id: ''
                    log_id: ''
                    error_code: 0
                    error_code_str: ''
                    error_msg: ''
                    error_detail:
                      status_code: 200
                      code: ''
                      code_message: ''
                      message: ''
                    task_type: sync
                    result: ''
                example-1:
                  summary: Async
                  value:
                    request_id: ''
                    log_id: ''
                    error_code: 0
                    error_code_str: ''
                    error_msg: ''
                    error_detail:
                      status_code: 200
                      code: ''
                      code_message: ''
                      message: ''
                    task_type: async
                    task_id: ''
          description: Success
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: ailabapi-api-key
      description: API Key for authentication

````