> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Accessing SQD data with API keys

Starting May 19th 2026, 12:00 UTC, accessing legacy centralized gateways (a.k.a. v2 archives, a.k.a. the open private SQD Network - URLs starting with `https://v2.archive.subsquid.io`) **when self-hosting** will require an API key.

<Note>
  This change will not affect [Cloud](/en/cloud) users relying on legacy gateways.
</Note>

We recommend that you create your API key and start using it immediately. Go to [portal.sqd.dev/app](https://portal.sqd.dev/app) or press the button below:

<Card title="The API keys app" icon="key" href="https://portal.sqd.dev/app">
  Register and create your gateway API key
</Card>

This API keys app will be also used to issue Portal API keys in the near future.

## Using an API key in Squid SDK

<Steps>
  <Step title="Check if your squid uses a legacy gateway">
    * If you have a `.setGateway()` call in your processor or data source configuration, you'll need to supply a key.
    * If your squid is Portal-based (`.setPortal()`) or RPC-only (neither `.setGateway()` nor `.setPortal()` in processor configuration), you don't need to do anything at the moment.
  </Step>

  <Step title="Update @subsquid packages">
    <Tabs>
      <Tab title="NPM">
        ```bash theme={"system"}
        npx --yes npm-check-updates --filter '@subsquid/*' --target semver --upgrade && npm i
        ```
      </Tab>

      <Tab title="PNPM">
        ```bash theme={"system"}
        npx --yes npm-check-updates --filter '@subsquid/*' --target semver --upgrade && pnpm i
        ```
      </Tab>

      <Tab title="Yarn">
        ```bash theme={"system"}
        npx --yes npm-check-updates --filter '@subsquid/*' --target semver --upgrade && yarn
        ```
      </Tab>

      <Tab title="Bun">
        ```bash theme={"system"}
        npx --yes npm-check-updates --filter '@subsquid/*' --target semver --upgrade && bun i
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Update your processor / data source">
    Add your API key to the argument of the `.setGateway` call, for example:

    ```diff theme={"system"}
    -  .setGateway('https://v2.archive.subsquid.io/network/ethereum-mainnet')
    +  .setGateway({
    +    url: 'https://v2.archive.subsquid.io/network/ethereum-mainnet',
    +    apiKey: 'your_api_key'
    +  })
    ```
  </Step>
</Steps>

Done. With this, you'll be able to continue using legacy gateways in your self-hosted setup when the authentication requirements are made strict.
