Docs
Search⌘ K
  • Home
  • About The Graph
  • Supported Networks
  • Protocol Contracts
  • Subgraphs
    • Substreams
      • Token API
        • Indexing
          • Resources
            Subgraphs > Querying

            2 minutes

            How to Manage API keys

            This guide shows you how to create, manage, and secure API keys for your Subgraphs.

            Overview

            API keys are required to query Subgraphs. They authenticate users and devices, authorize access to specific endpoints, enforce rate limits, and enable usage tracking across The Graph.

            Prerequisites

            • A Subgraph Studio account

            Create a New API Key

            1. Navigate to Subgraph Studio
            2. Click the API Keys tab in the navigation menu
            3. Click the Create API Key button

            A new window will pop up:

            1. Enter a name for your API key
            2. Optional: You can enable a period spending limit
            3. Click Create API Key
            Create API Key Window

            Manage API Keys

            The “API keys” table lists existing API keys and allows you to manage or delete them. For each key, you can see its status, the cost for the current period, the spending limit for the current period, and the total number of queries.

            How to Set Spending Limits

            1. Find your API key in the API keys table
            2. Click the “three dots” icon next to the key
            3. Select “Manage spending limit”
            4. Enter your desired monthly limit in USD
            5. Click Save

            Manage spending limit: this is an optional monthly spending limit for a given API key, in USD. This limit is per billing period (calendar month).

            How to Rename an API Key

            1. Click the “three dots” icon next to the key
            2. Select “Rename API key”
            3. Enter the new name
            4. Click Save

            How to Regenerate an API Key

            1. Click the “three dots” icon next to the key
            2. Select “Regenerate API key”
            3. Confirm the action in the pop up dialog

            Warning: Regenerating an API key will invalidate the previous key immediately. Update your applications with the new key to prevent service interruption.

            API Key Details

            Monitoring Usage

            1. Click on your API key to view the Details page
            2. Check the Overview section for:
              • Total number of queries
              • GRT spent
              • Current usage statistics

            Restricting Domain Access

            1. Click on your API key to open the Details page
            2. Navigate to the Security section
            3. Click “Add Domain”
            4. Enter the authorized domain name
            5. Click Save

            Limiting Subgraph Access

            1. In the API key Details page
            2. Navigate to the Security section
            3. Click “Assign Subgraphs”
            4. Select the Subgraphs you want to authorize
            5. Click Save

            Additional Resources

            Deploying Using Subgraph Studio

            ⁠Edit on GitHub⁠

            How to QueryQuerying Best Practices
            On this page
            • Overview
            • Prerequisites
            • Create a New API Key
            • Manage API Keys
            • How to Set Spending Limits
            • How to Rename an API Key
            • How to Regenerate an API Key
            • API Key Details
            • Monitoring Usage
            • Restricting Domain Access
            • Limiting Subgraph Access
            • Additional Resources
            The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service