> For the complete documentation index, see [llms.txt](https://savv-pro.gitbook.io/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://savv-pro.gitbook.io/welcome/ai-eye-color-changer-api/quick-start.md).

# Quick Start

{% hint style="info" %}
**Good to know:**&#x20;

* **Your API key is private** – Keep it **secure** and never share it publicly.
* **Regenerate API Keys** – If your key is compromised, generate a new one from the **RapidAPI dashboard**.
* **Supported Formats** – The API works with **JPG, PNG, and WebP** images.
* **Include Required Headers** – Ensure your requests include the correct headers, such as **`x-rapidapi-key`**, for authentication.
* **Rate Limits Apply** – Check your **usage limits** on RapidAPI to avoid request failures.
  {% endhint %}

## 🔑 Get your API keys

Your API requests require authentication using an API key. Any request without a valid API key will return an error.

To get started:

1. **Sign up** on [**RapidAPI**](https://rapidapi.com) and subscribe to the [**AI Eye Color Changer**](https://rapidapi.com/hawksavvy-hawksavvy-default/api/ai-eye-color-changer/playground/apiendpoint_b00daa99-603d-41a4-b6af-7a4f8841517d).
2. **Obtain your API key** from your RapidAPI dashboard.

📌 **Note:** Keep your API key **secure** and do not share it publicly. If your key is compromised, you can regenerate a new one from the RapidAPI dashboard.

## Make your first request

You can quickly test the **AI Face Swap API** by requesting to swap faces in an image.

#### **📌 Request Format:**

* **Method:** `POST`
* **Endpoint:** `/ai-eye-color-changer`
* **Headers:**
  * `x-rapidapi-key: YOUR_API_KEY`
  * `Content-Type: multipart/form-data`
* **Body:** Upload the **source image** and the **target face image**

{% hint style="info" %}
**Good to know:**&#x20;

* **To remove an object from an image**, simply upload the **image file** in the request body. The API processes the request and returns a **URL to the edited image**.
* **Ensure the request includes the correct headers**, including your API key (`x-rapidapi-key`) for authentication.
* **Monitor your rate limits** based on your **subscription plan** to avoid request failures.
* **For troubleshooting**, check the **response message** for details on invalid parameters, authentication errors, or unsupported file formats.
* **Refer to the status codes documentation** to understand API response errors and their meanings.
  {% endhint %}

Take a look at how you might call this method using  `curl`:

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

```javascript
const axios = require('axios');

const encodedParams = new URLSearchParams();
encodedParams.set('color', '#880808');

const options = {
  method: 'POST',
  url: 'https://ai-eye-color-changer.p.rapidapi.com/public/eyes/color',
  headers: {
    'x-rapidapi-key': '45dd2c909emshc6860efd9bad512p1ba614jsn2ad6c4147afd',
    'x-rapidapi-host': 'ai-eye-color-changer.p.rapidapi.com',
    'Content-Type': 'application/x-www-form-urlencoded',
    accept: 'application/json'
  },
  data: encodedParams,
};

try {
	const response = await axios.request(options);
	console.log(response.data);
} catch (error) {
	console.error(error);
}
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
import axios from 'axios';

const encodedParams = new URLSearchParams();
encodedParams.set('color', '#880808');

const options = {
  method: 'POST',
  url: 'https://ai-eye-color-changer.p.rapidapi.com/public/eyes/color',
  headers: {
    'x-rapidapi-key': '45dd2c909emshc6860efd9bad512p1ba614jsn2ad6c4147afd',
    'x-rapidapi-host': 'ai-eye-color-changer.p.rapidapi.com',
    'Content-Type': 'application/x-www-form-urlencoded',
    accept: 'application/json'
  },
  data: encodedParams,
};

try {
	const response = await axios.request(options);
	console.log(response.data);
} catch (error) {
	console.error(error);
}
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://ai-eye-color-changer.p.rapidapi.com/public/eyes/color"

payload = { "color": "#880808" }
headers = {
	"x-rapidapi-key": "45dd2c909emshc6860efd9bad512p1ba614jsn2ad6c4147afd",
	"x-rapidapi-host": "ai-eye-color-changer.p.rapidapi.com",
	"Content-Type": "application/x-www-form-urlencoded",
	"accept": "application/json"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

{% endtab %}
{% endtabs %}
