API Key

Generating an API Key

API keys can be created on the API Access page. After you've generated your key, all you need to do is add it to the x-messari-api-key HTTP header to start making requests.


Using the API key

To access the Messari API, you must authenticate your requests using an API key. The API key must be included in the request headers using the x-messari-api-key header field. This ensures secure access and proper authorization for your API requests.


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:

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

  • Keep Your API Key Secure: Never share your API key publicly or commit it to version control (e.g., GitHub).
  • Use Environment Variables: Store API keys in environment variables rather than hardcoding them in your code.
  • Rotate API Keys Regularly: Periodically update your API key for security purposes.

Welcome to Messari's API Documentation. Before you proceed, please take a moment to review and understand that your use of this API is subject to and governed by our Terms of Use and Privacy Policy. By accessing and using this API, you agree to comply with the terms and conditions outlined in the Terms of Use and Privacy Policy. The Messari API is intended to be used for internal purposes and uses only. If you are interested in redistributing any data from our API, please reach out to [email protected]. Messari reserves the right to modify, update, or revive the API Documentation at any time without notice.