# Lips Application API

{% hint style="info" %}
**Good to know:** We only offer cloud APIs and our methods are kept up to date automatically with changes to the API.&#x20;
{% endhint %}

## Endpoints

### GET /api/generatekey

Generates a new API key. This endpoint is rate-limited to 1 request per month for the free tier.

#### Response

A JSON object containing the generated API key.

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

### POST /api/lips

Applies lipstick color to the lips in the image.

{% tabs %}
{% tab title="Parameters" %}

```
x-api-key (header): Your API key.
```

{% code overflow="wrap" %}

```
file (form-data): The image file. Should be of type png, jpg, jpeg, or heic.
```

{% endcode %}

```
color (form-data): The name of the color of the lipstick.
```

{% endtab %}

{% tab title="Response" %}
A JSON object containing the base64 string of the binary data of the processed image.

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

```

{% endtab %}
{% endtabs %}

### GET /api/lips-health

Check the application's health, the AI model, and the database.&#x20;

#### Response

A JSON object containing the following fields:

{% code overflow="wrap" %}

```json
- `status`: A string that indicates the overall health of the API. It can be either "healthy" or "unhealthy".
- `details`: A dictionary containing each component's status. The keys are the names of the components ("app", "model", "database"), and the values are strings describing the status of the component.
```

{% endcode %}

#### Status Codes

```json
- `200 OK`: The API is healthy.
- `503 Service Unavailable`: The API is unhealthy.
```

#### Example Response

```json
{
    "status": "healthy",
    "details": {
        "app": "App is running",
        "model": "AI model is loaded",
        "database": "Database is connected"
    }
}
```

{% hint style="info" %}
**Good to know:** The health check endpoint is useful for monitoring the health of the API and quickly identifying any issues with the application, the AI model, or the database.
{% endhint %}

***

## Error Codes

* **403**: Missing or invalid API key.
* **429**: API key exceeded request limit.
* **400**: No file part, selected file, or invalid file type.
* **415**: Unsupported encoded image file.

## Authentication

To authenticate your requests, include your API key in the `x-api-key` header.

## Request Limit

The `generatekey` endpoint is rate-limited to 1 request per month for the free tier. The `lips` endpoint is rate-limited to 100 requests per month per API key for the free tier.

## Acceptable Image Files

The `lips` endpoint accepts image files of type png, jpg, jpeg, and heic. The maximum file size is 5MB.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.robomua.com/reference/api-reference/lips-application-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
