API Reference
Change hair color
Change a person's hair color using one of 19 supported colors. Provide an RGB image and a color; no mask is required. The result is an RGB image with the same dimensions as the input. Each processed image costs 7 credits.
Model:
hair-colorCredit:7
post
/v1/images/haircolorAuthorization — This endpoint requires an API key. Pass it in the api-key header on every request. Learn more
Thời gian xử lý trung bình
Cho mỗi yêu cầu.
- Thời gian xử lý
- ≈ 3,5 giây
Yêu cầu đầu vào
Hình ảnh
- Định dạng
- JPEG, PNG, WEBP
- Độ phân giải tối đa
- 3000 × 3000 px
Use an RGB image. No mask is required. The output has the same dimensions as the input.
Parameters
| Name | Type | Status | Description |
|---|---|---|---|
input_image | file | Required | RGB image file or URL. No alpha-channel mask is required. |
color | string | Required | Hair color to apply. Use the exact supported token, including lavander.auburnblondeblueblackbrownburgundycaramelcopperdarkbluegreenindigojetblacklavanderpeachpinkplatinumredrosegoldsmokeumber |
Responses
Hair color changed successfully. The returned URL points to an RGB image with the input dimensions.SingleImageResponse
| Field | Type | Description |
|---|---|---|
created | integer | Unix timestamp of when the response was created |
data | object[] | |
url | string | URL to download the result image |
curl -X POST "https://api.snapedit.app/v1/images/haircolor" \
-H "api-key: YOUR_API_KEY" \
-F "input_image=@./image.png" \
-F "color=auburn"Response
{
"created": 1791244800,
"data": [
{
"url": "https://assets.snapedit.app/snapapi_test/haircolor/output.jpg"
}
]
}
