> ## 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.

# AI Halloween Mask

> AI Halloween Mask API adds spooky Halloween masks to portraits while preserving identity, lighting, background, and facial structure.



## OpenAPI

````yaml /openapi.json post /api/portrait/effects/ai-halloween-mask
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/ai-halloween-mask:
    post:
      tags:
        - AI PORTRAIT > Portrait Effects
      summary: AI Halloween Mask
      description: >-
        AI Halloween Mask API adds spooky Halloween masks to portraits while
        preserving identity, lighting, background, and facial structure.
      requestBody:
        description: >-
          Provide `mask_style` or `image_template`. If both are provided,
          `mask_style` takes precedence.
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - image
              anyOf:
                - required:
                    - mask_style
                - required:
                    - image_template
              properties:
                image:
                  type: string
                  description: |-
                    Source image. 
                    - Image format: `JPEG` `JPG` `PNG` `WEBP` 
                    - Image size: No more than 10 MB. 
                    - Image resolution: Less than 4096x4096px.
                  format: binary
                mask_style:
                  type: string
                  description: >-
                    Built-in mask preset. Provide either this field or
                    `image_template`. If both are provided, `mask_style` takes
                    precedence. See [Supported mask
                    styles](/docs/ai-portrait/effects/ai-halloween-mask/api#mask_style).
                  enum:
                    - 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
                    - 36
                    - 37
                    - 38
                    - 39
                    - 40
                    - 41
                    - 42
                    - 43
                    - 44
                    - 45
                    - 46
                    - 47
                    - 48
                    - 49
                    - 50
                    - 51
                    - 52
                    - 53
                    - 54
                    - 55
                    - 56
                    - 57
                    - 58
                    - 59
                    - 60
                    - 61
                    - 62
                    - 63
                    - 64
                    - 65
                    - 66
                    - 67
                    - 68
                    - 69
                    - 70
                    - 71
                    - 72
                    - 73
                    - 74
                    - 75
                    - 76
                    - 77
                    - 78
                    - 79
                    - 80
                    - 81
                    - 82
                    - 83
                    - 84
                    - 85
                image_template:
                  type: string
                  description: >-
                    Reference image for eyeshadow transfer. Provide this field
                    or `mask_style`. If both are provided, `image_template` is
                    ignored. 

                    - Image format: `JPEG` `JPG` `PNG` `WEBP` 

                    - Image size: No more than 10 MB. 

                    - Image resolution: Less than 4096x4096px.
                  format: binary
                aspect_ratio:
                  type: string
                  description: Output Image Aspect Ratio.
                  enum:
                    - auto
                    - '1:1'
                    - '3:4'
                    - '4:3'
                    - '9:16'
                    - '16:9'
                  default: auto
      responses:
        '200':
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PublicResponseFields'
                  - type: object
                    required:
                      - task_id
                    properties:
                      task_id:
                        $ref: '#/components/schemas/AsyncTaskId'
              example:
                request_id: ''
                log_id: ''
                error_detail:
                  code: ''
                  code_message: ''
                  message: ''
                task_id: ''
          description: Success
components:
  schemas:
    PublicResponseFields:
      type: object
      required:
        - request_id
        - log_id
        - error_detail
      properties:
        request_id:
          type: string
          description: Request ID for debugging.
        log_id:
          type: string
          description: Log ID for debugging.
        error_detail:
          $ref: '#/components/schemas/ErrorDetail'
    AsyncTaskId:
      type: string
      description: >-
        Task ID for querying [Querying Async Task
        Results](/docs/ai-common/async-task-results/api).
    ErrorDetail:
      type: object
      required:
        - code
        - code_message
        - message
      properties:
        code:
          type: string
          description: >-
            Error Code. See [Error
            Codes](/docs/response-description#error-codes).
        code_message:
          type: string
          description: Error summary.
        message:
          type: string
          description: Detailed error message.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: ailabapi-api-key
      description: API Key for authentication

````