> ## Documentation Index
> Fetch the complete documentation index at: https://docs.messari.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> All Messari API endpoints require an API key for authentication.

### Generating an API Key

<img src="https://mintcdn.com/messari-f8af6bf9/S-QldOK-JbnUNLbC/images/api-key.png?fit=max&auto=format&n=S-QldOK-JbnUNLbC&q=85&s=3dae55c2989ba7eb964663cffe9d475d" alt="Messari API Key Generation Interface" width="1275" height="766" data-path="images/api-key.png" />

### Access the API Dashboard

Navigate to the [API Access page](https://messari.io/account/api) in your Messari account.

Your API Key will be visible at the top of the page.

## Using the API Key

The API key must be included in the request headers using the `x-messari-api-key` header field:

```json theme={null}
{
  "headers": {
    "x-messari-api-key": "YOUR_API_KEY_HERE"
  }
}
```

## Permissions

API access is tiered based on your subscription level. By default, all users have access to the [Assets & Market Data](/api-reference/endpoints/metrics/metrics-api) and [Exchanges](/api-reference/endpoints/exchanges/exchanges-api) API endpoints.

For access to additional endpoints and services such as Fundraising, Intel, News & Topics, and more, please contact [sales@messari.io](mailto:sales@messari.io).

### Example Request (cURL)

The following example demonstrates how to send a request to the Messari API using cURL with the `x-messari-api-key` header:

```bash theme={null}
curl --location 'https://api.messari.io/ai/v1/chat/completions' \
--header 'x-messari-api-key: YOUR_API_KEY_HERE' \
--header 'Content-Type: application/json' \
--data '{
    "messages": [
        {
            "role": "user",
            "content": "Briefly explain what the Hyperliquid HyperEVM is"
        }
    ],
    "verbosity": "succinct",
    "response_format": "markdown"
}'
```

## Security Best Practices

<CardGroup cols={3}>
  <Card title="Secure Storage" icon="lock">
    Never share your API key publicly or commit it to version control
  </Card>

  <Card title="Environment Variables" icon="leaf">
    Store API keys in environment variables rather than hardcoding them
  </Card>

  <Card title="Regular Rotation" icon="rotate">
    Periodically update your API key for security purposes
  </Card>
</CardGroup>
