How to create a GPT for blockchain data

Jay Pozo
4 min readFeb 13, 2024

--

Unless you’ve been hiding under a rock, you know about ChatGPT.

Recently, the folks over at OpenAI opened up the ability for anyone to create custom GPTs that are experts in specific tasks or domains.

It seems like everyone and their cat is getting in on the GPT action these days. There’s a Pet Rock GPT, a Rizz GPT and even a Jesus GPT.

Well if you are looking for something a bit more useful, like a GPT you can use to query blockchain data, then you’ve come to the right place.

In this article I’ll show you how to use the Covalent Unified API (full disclosure: I work at Covalent) to build a GPT that uses the API to fetch and analyze data from over 200 blockchains.

Step #1: Create a GPT

Head on over to https://chat.openai.com/gpts/editor to start creating a new GPT.

Give it a name like “Blockchain Data GPT” and a description like “A GPT that can fetch and analyze blockchain data using the Covalent Unified API.”

Add your GPT name and description.

Step #2: Add GPT Actions

Actions let a GPT fetch information or do other things outside of ChatGPT. In this case we want to add the ability of calling the API for blockchain data.

Covalent provides an OpenAPI spec for all of their endpoints at https://api.covalenthq.com/v1/openapiv3/. A caveat though: The GPT creator can only have a maximum of 30 operations. At the time of publication, the Covalent Unified API has 59. There is a handy query parameter that lets you filter the OpenAPI spec called group-filter. Filter options are: class-a-security, class-a-base, class-a-nft, class-a-balance, class-a-transaction, class-b-xyk. These options map directly to the groups of endpoints on the Covalent API reference.

Let’s create a GPT that analyzes NFTs. For that we’ll use the following OpenAPI url: https://api.covalenthq.com/v1/openapiv3/?group-filter=class-a-nft.

Setup actions using the Covalent API OpenAPI endpoint.

All of the NFT endpoints will now be available to your GPT.

You do need a Covalent API key, which you can get by signing up on the platform.

Once you get your key, add it to the Authentication field for your actions, using Bearer Authentication.

Add your API key using Bearer Authentication.

Step #3: Add GPT Instructions

The Instructions give your GPT the context under which it should operate. This is usually a few sentences or paragraphs that describe how the GPT should behave, how it should interact with the user, things like that. This is an example of some instructions you could provide for a GPT that can be helpful for fetching and exploring blockchain data, specifically for NFTs:

“You are a helpful chatbot that utilizes the Covalent API to fetch blockchain data, specifically for NFTs. You know when and how to display images related to the returned data. You are able to understand what data you can fetch, based on the actions you know, and communicate that to the user.”

Save your GPT and publish it for yourself or others to use with the caveat that free Covalent API keys are limited to 100,000 credits per month.

Step #4: Talk to your GPT

You can now ask your GPT about different addresses and NFTs.

One caveat: large responses are not handled well by the GPT. For some addresses with large NFT collections, like pranksy.eth, it fails. But it does do it gracefully.

Try this with the other Covalent API endpoints and feel free to share what you build!

--

--

Jay Pozo

Experienced tech and startup leader with 25+ years in the industry. Passionate about business, design systems, processes and photography.