Docs
Search⌘ K
  • Home
  • About The Graph
  • Supported Networks
  • Protocol Contracts
  • Subgraphs
    • Substreams
      • Indexer Software
        • Gateway Software
          • Data Services
            • AI Tooling
            • Resources
              Subgraphs > Gateway Providers > Graph Foundation

              8 minutes

              The Graph Foundation Gateway

              The Graph Foundation’s gateway serves GraphQL queries for Subgraphs on The Graph Network to applications that pay with a Subgraph Studio API key, in GRT or by credit card. It is for teams that want to build, publish, and query in one place: Subgraph Studio to deploy and publish, Graph Explorer to find Subgraphs, and gateway.thegraph.com to query them.

              This page describes the gateway that The Graph Foundation operates. You can use Subgraph Studio to deploy and publish Subgraphs whichever gateway you query through; see Subgraph Studio. For all gateways, see Subgraph Gateway Providers.

              OperatorThe Graph Foundation
              NetworkThe Graph Network
              StatusOperated by The Graph Foundation
              Sign upSubgraph Studio, by connecting a wallet
              Endpointhttps://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID> or https://gateway.thegraph.com/api/<API_KEY>/deployments/id/<DEPLOYMENT_ID>
              AuthenticationSubgraph Studio API key, in the path or as a bearer token in the Authorization header. Or x402 pay-per-query, with no API key
              Payment methodsGRT on Arbitrum One, or credit card, invoiced monthly. USDC on Base for x402
              SupportThe Graph Discord⁠ and [email protected]⁠
              Indexer transparency dataGateway QoS Oracle

              How The Graph Foundation Gateway Works

              1. Your application sends a GraphQL query to gateway.thegraph.com, identifying the Subgraph by Subgraph ID or Deployment ID, and authenticates with your Subgraph Studio API key.
              2. The gateway checks the key and its restrictions, such as allowed domains, Subgraphs, and spending limits, resolves the identifier to a Deployment ID, and records the query against your billing account.
              3. The gateway selects Indexers that serve the deployment, routes the query to them, and pays them in GRT through GraphTally.
              4. The response returns to your application.

              You pay The Graph Foundation monthly, from a GRT billing balance or by credit card.

              Foundation Gateway Pricing & Payments

              The Foundation Gateway offers two plans for querying Subgraphs through Subgraph Studio.

              • Free Plan: The Free Plan includes a monthly allowance of free queries, with full access to the Subgraph Studio testing environment. This plan is designed for hobbyists, hackathoners, and those with side projects to try out The Graph before scaling their dapp.

              • Growth Plan: The Growth Plan includes everything in the Free Plan, and you pay with GRT or credit card for queries beyond the free allowance. The Growth Plan is flexible enough to cover teams that have established dapps across a variety of use cases.

              For current allowances and rates, see Subgraph Studio pricing.

              How to Set Up Billing on The Graph Network

              Query Payments with credit card

              • To set up billing with credit/debit cards, users should access Subgraph Studio (https://thegraph.com/studio/)
                1. Go to the Subgraph Studio Billing page.
                2. Click on the “Connect Wallet” button on the top right corner of the page. You’ll be redirected to the wallet selection page. Select your wallet and click on “Connect”.
                3. Choose “Upgrade plan” if you are upgrading from the Free Plan or choose “Manage Plan” if you have already added GRT to your billing balance in the past. Next, you can estimate the number of queries to get a pricing estimate, but this is not a required step.
                4. To choose a credit card payment, choose “Credit card” as the payment method and fill out your credit card information. Those who have used Stripe before can use the Link feature to autofill their details.
              • Invoices will be processed at the end of each month and require an active credit card on file for all queries beyond the free plan quota.

              Query Payments with GRT

              You can use The Graph Token (GRT) to pay for queries through The Graph Foundation’s Gateway. With GRT, invoices are processed at the end of each month and require a sufficient balance of GRT to make queries beyond the Free Plan allowance. You’ll be required to pay fees generated from your API keys. Using the billing contract, you’ll be able to:

              • Add and withdraw GRT from your account balance.
              • Keep track of your balances based on how much GRT you have added to your account balance, how much you have removed, and your invoices.
              • Automatically pay invoices based on query fees generated, as long as there is enough GRT in your account balance.

              To add GRT to your billing balance or withdraw it, see Getting GRT:

              • Adding GRT using a wallet
              • Withdrawing GRT using a wallet
              • Adding GRT using a multisig wallet

              Your GRT Must Be on Arbitrum One

              The Graph protocol started on Ethereum Mainnet and now runs on Arbitrum One, so Subgraph Studio’s billing contract holds your balance on Arbitrum One. Before you add GRT to your billing balance, make sure you have:

              • GRT: GRT on Arbitrum One is the simplest option. Studio also accepts GRT from Ethereum Mainnet and bridges it to Arbitrum One for you during deposit, which takes about 15-20 minutes.
              • ETH on Arbitrum One: You need a small amount of ETH on Arbitrum One to pay gas for the deposit transaction.

              Don’t have GRT or ETH yet? See Getting GRT. To move GRT you already hold on Ethereum Mainnet into your wallet on Arbitrum One, see Bridging GRT.

              Sign Up and Get an API Key

              1. Open Subgraph Studio and connect your wallet.
              2. Click the API Keys tab, then Create API Key.
              3. Name the key and, optionally, set a monthly spending limit.
              4. Store the key in your secret manager.

              You can restrict a key to specific domains and Subgraphs. See Managing API Keys.

              Query a Subgraph

              Query by Subgraph ID to follow the versions its owner publishes on The Graph Network:

              1curl "https://gateway.thegraph.com/api/subgraphs/id/<SUBGRAPH_ID>" \2  -H "Authorization: Bearer $GRAPH_API_KEY" \3  -H "Content-Type: application/json" \4  --data '{"query": "{ _meta { deployment block { number } hasIndexingErrors } }"}'

              Query by Deployment ID (starting with Qm) to stay on one exact version:

              1curl "https://gateway.thegraph.com/api/deployments/id/<DEPLOYMENT_ID>" \2  -H "Authorization: Bearer $GRAPH_API_KEY" \3  -H "Content-Type: application/json" \4  --data '{"query": "{ _meta { deployment block { number } hasIndexingErrors } }"}'

              GraphQL reports query problems in an errors array, often with HTTP status 200, so check for errors as well as the status code. For the difference between the two IDs, see Subgraph ID vs Deployment ID.

              Publish a Subgraph

              Publish in Subgraph Studio or with the Graph CLI. Publishing is an on-chain action on The Graph Network, so every gateway can serve the Subgraph, not only The Graph Foundation’s gateway. See Publishing a Subgraph.

              Supported Networks

              Queries reach Subgraphs on every network The Graph Network serves. Which networks Subgraph Studio and the Upgrade Indexer support is shown on Supported Networks.

              Additional Services

              • Subgraph Studio: deploy versions, test them with a development query URL, and publish. See Subgraph Studio.
              • Graph Explorer: find published Subgraphs and copy their query URLs. See Using Graph Explorer.
              • Upgrade Indexer: query support for newly deployed Subgraphs before other Indexers pick them up, under the Fair Use Policy.
              • x402 payments: pay per query in USDC, with no account. See x402 Payments.
              • AI agents: Subgraph MCP and Subgraph Skills.

              Billing FAQs

              How many queries will I need?

              You don’t need to know how many queries you’ll need in advance. You will only be charged for what you use and you can withdraw GRT from your account at any time.

              We recommend you overestimate the number of queries you will need so that you don’t have to top up your balance frequently. A good estimate for small to medium sized applications is to start with 1M-2M queries per month and monitor usage closely in the first weeks. For larger apps, a good estimate is to use the number of daily visits your site gets multiplied by the number of queries your most active page makes upon opening.

              Both new and existing users can reach out to The Graph Foundation’s BD team⁠ or @brandonlkramer on Telegram for a consult on anticipated usage.

              Where can I get GRT to pay for queries?

              You can buy GRT on centralized exchanges like Coinbase and Binance, or swap for it on Uniswap on Arbitrum One. See Getting GRT for step-by-step instructions, including how to get the ETH you need for gas.

              Does my GRT need to be on Arbitrum One?

              Your billing balance is held on Arbitrum One. You can deposit GRT from Arbitrum One directly, or deposit GRT from Ethereum Mainnet and Subgraph Studio will bridge it for you. To move GRT in your own wallet between networks, see Bridging GRT.

              Can I withdraw GRT from my billing balance?

              Yes, you can always withdraw GRT that has not already been used for queries from your billing balance. The billing contract is only designed to bridge GRT from Ethereum mainnet to the Arbitrum network. Withdrawals are sent to your wallet on Arbitrum One. If you’d like to move that GRT back to Ethereum Mainnet, see Bridging GRT.

              What happens when my billing balance runs out? Will I get a warning?

              You will receive several email notifications before your billing balance runs out.

              Support

              For questions about the gateway, Subgraph Studio, or billing, email [email protected]⁠. For questions about The Graph Network, use The Graph Discord⁠. Report protocol and software bugs in the public GitHub repositories, such as graphprotocol/graph-node⁠.

              For Indexers

              The Foundation’s QoS Oracle publishes quality-of-service data for The Graph Foundation’s gateway on-chain. It is public and needs no credentials: query the Gateway QoS Oracle Subgraph. For how it works, see Tracking Quality of Service.

              Related

              • Subgraph Gateway Providers
              • Choosing a Gateway
              • Subgraph Studio
              • Managing API Keys
              • Fair Use Policy
              • Subgraph Studio FAQs
              • Subgraph Gateway docs
              ⁠Edit on GitHub⁠

              OverviewSubgraph Studio
              On this page
              • How The Graph Foundation Gateway Works
              • Foundation Gateway Pricing & Payments
              • Query Payments with credit card
              • Query Payments with GRT
              • Sign Up and Get an API Key
              • Query a Subgraph
              • Publish a Subgraph
              • Supported Networks
              • Additional Services
              • Billing FAQs
              • How many queries will I need?
              • Where can I get GRT to pay for queries?
              • Does my GRT need to be on Arbitrum One?
              • Can I withdraw GRT from my billing balance?
              • What happens when my billing balance runs out? Will I get a warning?
              • Support
              • For Indexers
              • Related
              The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service