> ## 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 Filters API

> Face Filters API applies AI photo filters and special effects to transform image style with adjustable filter intensity.

## Request

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

### Image requirements

* **Image format**: `JPEG` `JPG` `PNG` `BMP`
* **Image size**: No more than 3 MB.
* **Image resolution**: Larger than 10x10px, smaller than 2000x2000px.

### 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                   | Description                                   |
| :-------------- | :------- | :------- | :---------------------- | :-------------------------------------------- |
| `image`         | YES      | `file`   |                         |                                               |
| `resource_type` | YES      | `string` | [Scope](#resource_type) | Picture style. [More Details](#resource_type) |
| `strength`      | YES      | `float`  | \[0, 1.0]               | Filter intensity.                             |

#### `resource_type`

| `resource_type` | Description     |
| :-------------- | :-------------- |
| `10001`         | White Tea       |
| `10002`         | Fair Skin       |
| `10003`         | Early Summer    |
| `10004`         | Tokyo           |
| `10005`         | Confession      |
| `10006`         | Warm Sunshine   |
| `10007`         | Rose            |
| `10008`         | Clarity         |
| `10009`         | Crystal Clear   |
| `10010`         | Sweet Mint      |
| `10011`         | Basic           |
| `10012`         | Heartbeat       |
| `10013`         | Muted Gray      |
| `10014`         | Cherry Pudding  |
| `10015`         | Natural         |
| `10016`         | Elegance        |
| `10017`         | Black and White |
| `10018`         | Fruit           |
| `10019`         | Love            |
| `10020`         | Winter          |
| `10021`         | Photo           |
| `10022`         | Summer          |
| `10023`         | Fragrance       |
| `10024`         | Charm           |
| `10025`         | Throb           |
| `10026`         | Beach           |
| `10027`         | Street Snap     |
| `10028`         | Sweet           |
| `10029`         | First Kiss      |
| `10030`         | Afternoon       |
| `10031`         | Vitality        |
| `10032`         | Hazy            |
| `10033`         | Joyful          |
| `10034`         | Fashion         |
| `10035`         | Bubbles         |
| `10036`         | Lemon           |
| `10037`         | Cotton Candy    |
| `10038`         | Brook           |
| `10039`         | Beauty          |
| `10040`         | Coffee          |
| `10041`         | Tender Bud      |
| `10042`         | Passion         |
| `10043`         | Gradual Warmth  |
| `10044`         | Breakfast       |
| `10045`         | White Tea       |
| `10046`         | Fair            |
| `10047`         | Holy            |
| `10048`         | Forest          |
| `10049`         | Surfing         |
| `10050`         | Milk Coffee     |
| `10051`         | Clear           |
| `10052`         | Breeze          |
| `10053`         | Sunset          |
| `10054`         | Water Glow      |
| `10055`         | Japanese Style  |
| `10056`         | Starlight       |
| `10057`         | Sunshine        |
| `10058`         | Falling Leaves  |
| `10059`         | Vitality        |
| `10060`         | Sweetheart      |
| `10061`         | Elegance        |
| `10062`         | Spring          |
| `10063`         | Rome            |
| `10064`         | Green           |
| `10065`         | Gentle Breeze   |
| `10066`         | Warm Heart      |
| `10067`         | Seawater        |
| `10068`         | Mysterious      |
| `10069`         | Vintage 1       |
| `10070`         | Vintage 2       |
| `10071`         | Snowy Peak      |
| `10072`         | Sunlight        |
| `10073`         | Floating Clouds |
| `10074`         | Flowing Colors  |
| `10075`         | Film            |
| `10076`         | Nostalgia       |
| `10077`         | Cheese          |
| `10078`         | Butterfly       |

## 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     | Description                              |
| :----------- | :------- | :--------------------------------------- |
| `data`       | `object` | The content of the result data returned. |
| +`image_url` | `string` | Resulting image URL address.             |

<Tip>
  All result URLs are temporarily available and will expire after 24 hours.
</Tip>

### Response Example

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


## OpenAPI

````yaml POST /api/portrait/effects/face-filter
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-filter:
    post:
      tags:
        - AI PORTRAIT > Portrait Effects
      summary: Face Filters
      description: >-
        Face Filters API applies AI photo filters and special effects to
        transform image style with adjustable filter intensity.
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                image:
                  type: string
                  format: binary
                resource_type:
                  type: string
                  description: Picture style.
                strength:
                  type: string
                  description: Filter intensity.
      responses:
        '200':
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              example:
                request_id: ''
                log_id: ''
                error_detail:
                  code: ''
                  code_message: ''
                  message: ''
                data:
                  image_url: ''
          description: Success
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: ailabapi-api-key
      description: API Key for authentication

````