Here is a step-by-step explanation of how to do it :)
- Let`s start by visiting the https://thegraph.com/studio/

- Click on Connect to connect your wallet to Subgraph Studio

- Click on API Keys to generate your subgraph API

- Click on Create API Key and create it

- After creating your API Key, copy it and store it in a notepad.
