Authentication
Authenticate every request with an API key in the X-API-Key header.
All analysis endpoints require an API key, sent in the X-API-Key header or as Authorization: Bearer <key>.
Getting a key
- Sign in at business.lushair.ai with your email.
- Open Keys in the dashboard and create your key. Usage and your plan are on the same dashboard.
- Treat the key as a secret: send it only in the header, never in URLs or client-side code.
Request format
curl -X POST https://api.lushair.ai/functions/v1/v1-hair/analysis_hairline \
-H "X-API-Key: YOUR_API_KEY" \
-F "[email protected]" \
-F 'meta={"gender":2,"age":30,"language":"en"}'Images are sent as files in a multipart request. We do not fetch image links: a JSON request with an image_url link returns 400 image_url_not_supported, and the call still counts. analysis_hair_spectrum and analysis_follicle_miniappv2 take JSON only, with each image as a base64 data URL (data:image/jpeg;base64,...).
Errors
| HTTP | Response Body | Meaning |
|---|---|---|
| 401 | {"code": 401, "msg": "This API key is not valid. Check it, or create a new one in Lushair Business.", "data": {"error_code": "invalid_key"}} | The API key is invalid. A missing key returns the same shape with missing_key. |
| 400 | {"code": 400, "msg": "Missing required parameter ..."} | A required parameter is missing. The message identifies the missing field. |
| 400 | {"code": 400, "msg": "image_url: send the photo as a base64 data URL or as a multipart file. Image links are not fetched.", "data": {"error_code": "image_url_not_supported", "field": "image_url"}} | An image was sent as a link. The call still counts. |
| 404 | — | The request was sent to the wrong domain. See the endpoint documentation below. |
The JSONcodefield is not always equal to the HTTP status. Use the HTTP status for control flow and themsgfield for diagnostics.
Domains
One platform, two domains, enforced server-side:
| Domain | Serves |
|---|---|
https://api.lushair.ai/functions/v1/v1-hair | Hair, hairline and follicle endpoints |
https://api.glamskin.ai | Skin endpoints |
Calling an endpoint on the wrong domain, or on https://api.lushair.ai without the /functions/v1/v1-hair prefix, returns 404. If you get an unexpected 404, check the base URL before anything else.
Rate limits
Limits are per key and shown in your account dashboard (queries per minute and total calls per period). Exceeding them returns an error; back off and retry after a minute. Calls used on your dashboard count per position on analysis_hair_full and analysis_hair_multi, so a scan with several positions counts as several units.
Timeouts
All endpoints are synchronous and return the full result in a single response. The first call after a quiet period is a cold call, while the model starts. Cold calls took about 15 to 23 seconds in measured calls. Set client timeouts to at least 60 seconds. The server stops a call at 140 seconds and does not charge for it. Fewer images return faster.
Result images
Image links in a response (url fields) are signed and expire after 1 hour. Download them right away if you need to keep them.
Updated 20 days ago
