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

# Age & Gender swap

> Age & Gender Swap API edits portrait attributes to change age or gender and generate realistic face transformation effects.



## OpenAPI

````yaml /docs/openapi.json post /api/portrait/effects/face-attribute-editing
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-attribute-editing:
    post:
      tags:
        - AI PORTRAIT > Portrait Effects
      summary: Age & Gender swap
      description: >-
        Age & Gender Swap API edits portrait attributes to change age or gender
        and generate realistic face transformation effects.
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                image:
                  type: string
                  format: binary
                action_type:
                  type: string
                  description: |-
                    Face editing method. 
                    - `TO_KID`: V1 version becomes a child. 
                    - `TO_OLD`: V1 version becomes old man. 
                    - `TO_FEMALE`: V1 version becomes girls. 
                    - `TO_MALE`: V1 version becomes boys. 
                    - `V2_AGE`: V2 version age change. 
                    - `V2_GENDER`: v2 version gender shift.
                quality_control:
                  type: string
                  description: >-
                    Image quality (`image` field image quality). <br/>Please
                    select the appropriate option based on quality information
                    such as masking, lighting, blurriness, and integrity of the
                    face. <br/>If selecting a higher quality causes the image to
                    be unprocessable, please select a lower quality to try. 

                    - `NONE`: No control is performed. 

                    - `LOW`: Lower quality requirements. 

                    - `NORMAL`: General quality requirements. 

                    - `HIGH`: Higher quality requirements.
                face_location:
                  type: string
                  description: >-
                    When multiple faces are detected in the image, use this
                    parameter to specify the position of the face to be edited
                    in the image, or default to the largest face in the image if
                    not specified.
                target:
                  type: string
      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: ''
                result:
                  image: ''
          description: Success
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: ailabapi-api-key
      description: API Key for authentication

````