Skip to main content
Service keys are long-lived credentials that you create from the Gatelit dashboard. They are designed for server-side callers — backend services, scheduled jobs, AI agents, or any automated pipeline that calls the gateway without a human user present.
Treat service keys like passwords. Anyone who holds a key can make requests through your gateway. Never expose service keys in frontend code, commit them to source control, or include them in client-side bundles.

Creating a key

  1. Open the Gatelit dashboard and navigate to Settings → Service Keys.
  2. Click New key, give it a descriptive name (e.g. data-pipeline-prod), and confirm.
  3. Copy the key immediately — it is only shown once.
  4. Store it in your environment’s secret manager (e.g. as an environment variable or a secrets vault entry).

Using a service key

With GatelitClient

Pass the key in getToken with scheme: "GatelitKey":

Direct HTTP request

If you’re calling the gateway without the SDK, set the Authorization header manually:

Shell / cURL

Key rotation

You should rotate service keys periodically or immediately if a key is suspected to have been exposed.
1

Create a new key

In the dashboard, go to Settings → Service Keys and create a new key. Give it a distinct name so you can track which services use it.
2

Deploy the new key

Update the environment variable or secret store entry in your service to use the new key value. Deploy your service.
3

Revoke the old key

Once your service is running with the new key and all in-flight requests using the old key have completed, return to the dashboard and revoke the old key.
Keep one key per service or pipeline rather than sharing a single key across multiple callers. This makes rotation and incident response straightforward — you can revoke a compromised key without affecting unrelated services.