[Important: API Service Retirement Announcement]Dear Developers,Thank you for your continued trust and support in AILabTools API. In order to provide more efficient and reliable services, we will officially deprecate the current version of this API.As this interface is based on an outdated architecture and its performance can no longer meet evolving needs, it will no longer be available starting from the date of this announcement.We kindly recommend that you evaluate and adopt an alternative solution as soon as possible to ensure a smooth transition for your applications.If you have any questions or need assistance during the migration, please feel free to contact our support team:
📧 [email protected]We sincerely appreciate your understanding and cooperation, and we remain committed to delivering better and more advanced services for you.Warm regards,AILabTools Support Team
Request
- URL:
https://www.ailabapi.com/api/portrait/effects/hairstyle-editor - Method:
POST - Content-Type:
multipart/form-data
Image requirements
- Image format:
JPEGJPGPNGBMP - Image size: No more than 5 MB.
- Image resolution: Less than 4096x4096px.
Headers
| Field | Required | Type | Description |
|---|---|---|---|
ailabapi-api-key | YES | string | Application API KEY. Get API KEY |
Body
| Field | Required | Type | Scope | Default | Description |
|---|---|---|---|---|---|
image_target | YES | file | |||
hair_type | NO | integer | 0, 1, 2, 3, 901 | 0 | 0`: Bangs.`, 1: Long hair., 2`: Bangs with long hair.`, 3: Increase the number of hair., “901: Straight hair. |
Response
Response Field Handling Flow-
Handle
Public Response FieldsParse and validate thePublic Response Fields, checking the status code or response message to ensure the request is successful and error-free. -
Handle
Business Response FieldsIf thePublic Response Fieldsare valid and error-free, proceed with processing the business logic in theBusiness Response Fields.
Public Response Fields
Viewing Public Response Fields and Error CodesBusiness Response Fields
| Field | Type | Description |
|---|---|---|
data | object | The content of the result data returned. |
+image | string | The result image, returning the Base64 encoding of the image. |

