> ## 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 Beard Styling API

> AI Beard Styling API adds realistic beard and mustache styles to portraits for grooming apps, barbershop tools, and virtual try-ons.

export const beards = [{
  value: "AnchorBeardClean",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/AnchorBeardClean.jpg"
}, {
  value: "AnchorBeardFull",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/AnchorBeardFull.jpg"
}, {
  value: "Balbo",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/Balbo.jpg"
}, {
  value: "Bandholz",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/Bandholz.jpg"
}, {
  value: "ChevronMoustache",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/ChevronMoustache.jpg"
}, {
  value: "ChinStrap",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/ChinStrap.jpg"
}, {
  value: "CircleBeard",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/CircleBeard.jpg"
}, {
  value: "CorporateBeard",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/CorporateBeard.jpg"
}, {
  value: "DucktailBeardFull",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/DucktailBeardFull.jpg"
}, {
  value: "DucktailBeardPointed",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/DucktailBeardPointed.jpg"
}, {
  value: "ExtendedGoatee",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/ExtendedGoatee.jpg"
}, {
  value: "FullBeardClassic",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/FullBeardClassic.jpg"
}, {
  value: "FullBeardTapered",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/FullBeardTapered.jpg"
}, {
  value: "Garibaldi",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/Garibaldi.jpg"
}, {
  value: "Goatee",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/Goatee.jpg"
}, {
  value: "HandlebarMoustache",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/HandlebarMoustache.jpg"
}, {
  value: "HeavyStubble",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/HeavyStubble.jpg"
}, {
  value: "ImperialMoustache",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/ImperialMoustache.jpg"
}, {
  value: "MuttonChops",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/MuttonChops.jpg"
}, {
  value: "PetiteGoatee",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/PetiteGoatee.jpg"
}, {
  value: "SoulPatch",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/SoulPatch.jpg"
}, {
  value: "VanDyke",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/VanDyke.jpg"
}, {
  value: "VanDykeRefined",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/VanDykeRefined.jpg"
}, {
  value: "Verdi",
  image: "https://ai-resource.ailabtools.com/ai-beard-styling/beards/Verdi.jpg"
}];

## Query Task

<Tip>
  This is an asynchronous task API. The submission request returns only `task_id`.

  Use `task_id` to call [Querying Async Task Results](/docs/ai-common/async-task-results/api) and retrieve the final result. Async task results remain available for 24 hours. Query every 5 seconds.
</Tip>

| Field             | Type     | Description        |
| :---------------- | :------- | :----------------- |
| `data`            | `object` | Final result data. |
| +`result_urls`    | `array`  | Result image URLs. |
| ++`result_urls[]` | `string` | Result image URL.  |

```json theme={null}
{
  "data": {
    "result_urls": [""]
  }
}
```

<Tip>
  `result_urls` are temporary and remain valid for 24 hours. Download the files to your own storage before the URLs expire if you need long-term storage.
</Tip>

## Submit Task

### `beard`

The following enum values are supported for `beard`.

<Expandable title="Available Beards">
  <div className="mt-2 grid grid-cols-2 lg:grid-cols-4 align-center gap-2">
    {beards.map((item) => (
            <div key={item.value} className="rounded-xl">
              <img className="w-full mt-0 mb-2 aspect-square object-contain rounded-xl" src={item.image} alt={item.value} />
              <code className="block break-all text-center text-xs">{item.value}</code>
            </div>
          ))}
  </div>
</Expandable>


## OpenAPI

````yaml POST /api/portrait/editing/ai-beard-styling
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/editing/ai-beard-styling:
    post:
      tags:
        - AI PORTRAIT > Portrait Editing
      summary: AI Beard Styling
      description: >-
        AI Beard Styling API adds realistic beard and mustache styles to
        portraits for grooming apps, barbershop tools, and virtual try-ons.
      requestBody:
        description: >-
          Provide `beard` or `image_template`. If both are provided, `beard`
          takes precedence.
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - image
              anyOf:
                - required:
                    - beard
                - required:
                    - image_template
              properties:
                image:
                  type: string
                  description: |-
                    - Image format: `JPEG` `JPG` `PNG` `WEBP` 
                    - Image size: No more than 10 MB. 
                    - Image resolution: Less than 4096x4096px.
                  format: binary
                beard:
                  type: string
                  description: >-
                    Built-in beard preset. Provide this field or
                    `image_template`. If both are provided, `beard` takes
                    precedence. See [Supported beard
                    values](/docs/ai-portrait/editing/ai-beard-styling/api#beard).
                  enum:
                    - FullBeardClassic
                    - CorporateBeard
                    - Garibaldi
                    - Verdi
                    - FullBeardTapered
                    - VanDyke
                    - Bandholz
                    - VanDykeRefined
                    - Goatee
                    - ExtendedGoatee
                    - Balbo
                    - AnchorBeardClean
                    - DucktailBeardPointed
                    - AnchorBeardFull
                    - DucktailBeardFull
                    - HeavyStubble
                    - ChevronMoustache
                    - HandlebarMoustache
                    - ImperialMoustache
                    - CircleBeard
                    - ChinStrap
                    - MuttonChops
                    - SoulPatch
                    - PetiteGoatee
                image_template:
                  type: string
                  description: >-
                    Reference image for beard transfer. Provide this field or
                    `beard`. 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
      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

````