---
updatedAt: 2026-05-20T07:49:27.000Z
---

Fetch the complete documentation index at: https://docs.blockdaemon.com/llms.txt. Use this file to discover all available pages before exploring further. Append .md to any documentation page URL to get its markdown version.

# Authentication

Use your API key to securely interact with DeFi protocols across chains. This page shows how to get your key, pass it in requests, and validate that it works.

> 👍 Reference
>
> For background on **expand.network by Blockdaemon** and setup instructions, see:
>
> * **[Overview](https://docs.blockdaemon.com/docs/defi-api-overview)**
> * **[Supported Protocols](https://docs.blockdaemon.com/docs/defi-api-supported-protocols)**
> * **[Pricing](https://www.expand.network/pricing)**

## 1. Get an API Key

Sign up at [app.blockdaemon.com](https://app.blockdaemon.com/signin) to create an account and generate your DeFi API key.

<HTMLBlock>{`
<style>
	.api_key_instruct_ban {
		background: #DCD3F1;
		border-radius: 12px;
		-webkit-border-radius: 12px;
		display: flex;
		flex-wrap: wrap;
		padding: 33px;
	}

	.api_key_instruct_ban_lft h3 {
		font-size: 24px;
    line-height: 1.3;
    color: #211B4E;
		letter-spacing: -0.03em;
    font-weight: 700;
		font-family: 'Inter', sans-serif;
		margin-bottom: 7px;
		margin-top: 0px;
	}

	.api_key_instruct_ban_lft h3:last-child {
		margin-bottom: 0;
	}

	.api_key_instruct_ban_lft p {
		font-size: 14px;
		line-height: 1.3;
		color: #211B4E;
		font-family: 'Inter', sans-serif;
		font-weight: 400;
	}
  
  .api_key_instruct_ban_lft {
  	flex-basis: 80%;
   	max-width: 80%;
  	padding-right: 15px;
                                }
  
  .api_key_instruct_ban_rtt {
     flex-basis: 20%;
     max-width: 20%;
     padding-left: 15px;
     align-self: center;
                                }
  
	.gt_startd_vbtn {
		display: inline-block;
    white-space: nowrap;
		color: #FFFFFF !important;
		background: linear-gradient(126.33deg, #3D1C8C 5.38%, #6C48C3 108.32%);
		border-radius: 6px;
		font-size: 16px;
		line-height: 1.3;
		font-weight: 600;
		font-family: 'Inter', sans-serif;
    text-decoration: none !important;
		padding: 10px 16px;

	}

	.gt_startd_vbtn:hover {
		background: #211B4E;
		color: #fff;
	}
  
  @media only screen and (max-width:768px) {
    .api_key_instruct_ban {
    	display: block;
    }
    
    .api_key_instruct_ban_rtt {
    	padding-left: 0;
    }
  }
</style>


<div class="api_key_instruct_ban">
	<div class="api_key_instruct_ban_lft">
		<h3>Need a DeFI API key?</h3>
			<p>Interact with a variety of DeFi protocols across many Blockchains through a uniform and consistent API</p>
	</div>

	<div class="api_key_instruct_ban_rtt">
		<a href="https://www.blockdaemon.com/api/defi#form" class="gt_startd_vbtn">Get Started</a>
	</div>
</div>


`}</HTMLBlock>

## 2. Authenticate Requests

### Method 1: As a Query Parameter

Add your API key to the request URL using `?apiKey=YOUR_API_KEY`.

```curl
curl "https://svc.blockdaemon.com/tokens/v1?apiKey=YOUR_API_KEY"
```

You can use this method with any tool without needing extra steps. Note that if the URL already has other parameters, replace `?` with `&`.

### Method 2: As a Bearer Token

Use the `Authorization` header with your API key as a bearer token.

```curl
curl -X GET "https://svc.blockdaemon.com/tokens/v1" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Method 3: As an X-API-Key Header

Add your API key using the `X-API-Key` header.

```curl
curl -X GET "https://svc.blockdaemon.com/tokens/v1" \
  -H "X-API-Key: YOUR_API_KEY"
```

## 3. Test Your API Key

You can try to validate your key by calling the [`/tokens/v1`](https://docs.blockdaemon.com/reference/defi-tokens-get-tokens-metadata) endpoint:

```bash
curl -X GET "https://svc.blockdaemon.com/tokens/v1" \
  -H "X-API-Key: YOUR_API_KEY" | jq
```

:white\_check\_mark: A **successful** response returns supported token metadata:

```json
[
    {
      "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "chainID": "eip155:1",
      "decimals": 6,
      "extensions": {
        "homepage": "https://www.circle.com/en/usdc",
        "verified": true
      },
      "logoURI": "https://defi-images-blockdaemon-research-development-int-aa593eebdaa2fd.gitlab.io/tokens/1-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.webp",
      "name": "USDC",
      "priceUSD": 0.999737,
      "symbol": "USDC",
      "tags": [
        "stargateV2",
        "stargateV1",
        "stablecoin"
      ]
    }
]
```

:x: If your API key is **invalid** or **missing**, you'll get an error response below:

```json
{
  "type": "https://httpproblems.com/http-status/401",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Authorization Failed",
  "instance": "/defi/chains",
  "trace": {
    "timestamp": "2024-04-30T10:30:30.874Z",
    "requestId": "0b05fee3-b980-4655-a992-5c26f9192edd"
  }
}
```

## 👋 Need Help?

Contact us through [email](mailto:support@blockdaemon.com) or our [support page](https://www.blockdaemon.com/support) for any issues, bugs, or assistance you may need.