# Endpoint Security: API Key Management

After creating a private endpoint on the [Dashboard](https://www.nodies.app/dashboard), users will be able to add and manage API Keys to further enhance application security and control. Users can add and delete API keys, as well as whitelisting domains and IPv4 addresses if they so choose.&#x20;

<div align="left" data-full-width="false"><figure><img src="https://196680601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2rYhTFzQ2N3dGkNYGHaf%2Fuploads%2FTYuOnq8JRNJoZ0DgFG0f%2FScreenshot%202023-12-14%20at%2010.05.04%E2%80%AFAM.png?alt=media&#x26;token=638e1f9f-d318-49a3-92f2-784fddd4af05" alt=""><figcaption></figcaption></figure></div>

<figure><img src="https://196680601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2rYhTFzQ2N3dGkNYGHaf%2Fuploads%2FEuI77ZQS5qBlc49hQXLS%2FScreenshot%202023-12-14%20at%2010.06.30%E2%80%AFAM.png?alt=media&#x26;token=f421d015-9cd3-426a-8dc6-89deb593c74d" alt=""><figcaption></figcaption></figure>

After creating an API Key, you'll need include it in your requests. There are two ways to do this:

1. Using an x-api-key header (Recommended):

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

```bash
curl <endpoint_here> \
-X POST \
-H "x-api-key: <api_key_value>" \
-H "Content-Type: application/json" \
```

{% endtab %}

{% tab title="Python" %}

```python
from web3 import Web3
import requests

#define a http session with an api key
http_session = requests.Session()
http_session.update({'x-api-key': 'api_key_here'})

#defined the web3 provider
client = Web3.HTTPProvider('endpoint here')
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
import { Web3, HttpProvider } from 'web3';

// define web3 client
const client = new Web3(new HttpProvider('endpoint_here', {
    providerOptions: {
        headers: {
            "x-api-key": "api_key_value"
        }
    }
}));
```

{% endtab %}
{% endtabs %}

2. Appending the API Key as a query parameter in the URL:
3. Appending the API Key as a query parameter in the URL:

{% tabs fullWidth="false" %}
{% tab title="Curl" %}

```bash
curl "<endpoint_here>?apikey=<your-api-key>" \
-X POST \
-H "Content-Type: application/json" \
```

{% endtab %}

{% tab title="Python" %}

```python
from web3 import Web3
import requests

# Define the Web3 provider with API key in the URL
client = Web3(Web3.HTTPProvider('endpoint_here?apikey=api_key_here'))
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
import { Web3, HttpProvider } from 'web3';

// Define Web3 client with API key in the URL
const client = new Web3(new HttpProvider('endpoint_here?apikey=your-api-key'));
```

{% endtab %}
{% endtabs %}
