# Quick Start

{% hint style="info" %}
**Good to know:** Our current API is the Skin Shade Detection API. The Beauty & Fashion Product Recommendation API is also coming soon!
{% endhint %}

## Get your API Key

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

The best way to interact with our APIs is to use standard HTTP verbs as our APIs are organized around REST.

Before you start using the `skinshade` or `lips` endpoint, you need to generate an API key. This can be done by making a **GET** request to the `generatekey` endpoint. This endpoint is rate-limited to 1 request per month for the free tier.

Here is an example of how to make a request to the `generatekey` endpoint using curl:

```sh
curl --location 'https://api.robomua.com/api/generatekey'
```

The response will be a JSON object containing your API key:

```json
{
  "roboKey": "your-api-key"
}
```

{% hint style="info" %}
**Good to know:** To authenticate your API request, you will need to include the API key in the request header as follows:&#x20;

`x-api-key`: \<API\_KEY>

Be sure to replace \<API\_KEY> with your actual API key.
{% endhint %}

***

## Make your first request

Send an authenticated request to our endpoints to make your first request.&#x20;

This `skinshade` endpoint will fetch the exact skin shade of the person from the image file based on the user's skin tone and undertones, which is nice.&#x20;

The `lips` endpoint will return the processed image with the lipstick color applied to the lips.

The `hairswap` endpoint returns a processed image with the newly selected hairstyle.

Once you have your API key, you can start using the endpoints.&#x20;

All endpoints accept **POST** requests with an image file in the request body. The `lips` endpoint also requires the name of a color and the `hairswap` endpoint also requires a number corresponding to the preferred hairstyle.

The image file should be png, jpg, jpeg, or heic.

Here is an example of how to make a request to the `skinshade` endpoint using curl:

{% code overflow="wrap" %}

```shell
curl --location 'https://api.robomua.com/api/skinshade' \
--header 'x-api-key: your-api-key' \
--form 'file=@"/path/to/your/image.jpeg"'
```

{% endcode %}

The response will be a JSON object containing the detected skin shade and tone range:

```json
{
  "skinShade": "#hex-color",
  "toneRange": "tone-range"
}

```

Take a look at how you can use the `lips` endpoint via curl:

```sh
curl --location 'https://api.robomua.com/api/lips' \
--header 'x-api-key: your-api-key' \
--form 'file=@"/path/to/your/image.jpeg"' \
--form 'color="color-name"'
```

The response will be a JSON object containing a base64 string of the binary data of the image with the lipstick color applied:

```json
{
  "lipsImage": "base64-encoded-string"
}

```

Here is how you can send a request to the `hairswap` endpoint via curl:

```sh
curl --location 'api.robomua.com/api/hairswap' \
--header 'x-api-key: your-api-key' \
--form 'file=@"/path/to/your/image.jpeg""' \
--form 'hair="integer-for-style"'
```

You will get a JSON object response containing a base64 string of the binary data of the image with the new hairstyle:

```json
{
  "hairstyleImage": "base64-encoded-string"
}
```
