> For the complete documentation index, see [llms.txt](https://docs.metasleuth.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metasleuth.io/zh_cn/blocksec-fan-xi-qian-api/introduction/authentication.md).

# 身份验证

我们的API使用API密钥进行身份验证。为了确保您的数据安全，**请不要与任何人共享您的API密钥。**

### 如何获取API密钥？

要生成API密钥，请先[注册一个BlockSec账户](https://account.blocksec.com/signup?referer=https%3A%2F%2Fmetasleuth.io)。注册成功后，访问\_**设置**\_部分中的[APIs](https://metasleuth.io/settings?type=apis)面板，快速获取您的API密钥。

{% hint style="info" %}
如果您通过我们的销售渠道订阅了定制的API服务，请联系您的指定服务联系人以获取API密钥。
{% endhint %}

<figure><img src="/files/P6idY1svKWqeuLYTxW80" alt=""><figcaption></figcaption></figure>

### 如何使用API密钥

在每个API请求的HTTP请求头中包含"**API-KEY**"头，并将您的API密钥作为值提供。请参见以下示例。

{% code overflow="wrap" %}

```sh
curl -L \
  -X POST \
  -H 'Content-Type: application/json' \
  -H 'API-KEY:$API_KEY' \
  'https://aml.blocksec.com/address-label/api/v3/labels' \
  -d '{"chain_id":1,"address":"0x00d7e7409bfe09a736d3e993de9b87d0baa314d5"}'
```

{% endcode %}
