# 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="/files/02kMPWpk7CTyOFxzN0ur" alt=""><figcaption></figcaption></figure></div>

<figure><img src="/files/OmmPrTFVyy7HlxtLxVfW" 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 %}


---

# 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.nodies.app/application-guide/endpoint-security-api-key-management.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.
