API keys and Rate Limits - Relay

Relay API Keys Documentation

Rate Limits

Relay enforces rate limits to keep the platform reliable for every integrator. Default limits apply to unauthenticated traffic; an API key raises those limits and attributes each request to your account. You manage keys in the Relay Dashboard — create new keys, rotate existing ones, and inspect individual requests.


Creating an API key

API keys are self-serve. To create one:

  1. Sign in to the Relay Dashboard.
  2. Open the API keys tab.
  3. Click Create key, give it a label (e.g. production, staging), and copy the key.

Use a separate key per environment (production, staging, local). Per-key request history makes it easy to spot a misbehaving deploy without revoking the wrong credential.


Tracking requests

The Relay Dashboard is also where you observe what your integration is doing in production:

When debugging a specific transaction, paste the requestId from your application into the dashboard’s search to jump straight to the matching record.


Default Rate Limits (no API key)

The following limits apply to unauthenticated requests:

Endpoint Limit
/quote 50 requests per minute
/requests 200 requests per minute
/transactions/status 200 requests per minute
Other endpoints 200 requests per minute

API key Rate Limits

Authenticated requests get higher limits, applied per key:

Endpoint Limit
/quote 10 requests per second
/requests 10 requests per second
/transactions/status 10 requests per second
Other endpoints 200 requests per minute

API keys are recommended for server-side production integrations and higher-throughput use cases.


How to Use an API key

HTTP requests

Pass the key in the request headers on every call where you want elevated limits:

x-api-key: YOUR_API_KEY

SDK usage

Global API key

// Set apiKey only when using the SDK server-side.
import {
  createClient,
  MAINNET_RELAY_API,
} from "@relayprotocol/relay-sdk";

createClient({
  baseApiUrl: MAINNET_RELAY_API,
  apiKey: "YOUR_API_KEY",
  // ...other parameters
});
// Or pass the key per-call via the headers parameter.
import { getClient } from "@relayprotocol/relay-sdk";

const quoteParams = { /* ... */ };

const quote = await getClient()?.actions.getQuote(quoteParams, undefined, {
  "x-api-key": "YOUR_API_KEY",
});

Proxy API

If you’re calling the SDK from the browser, stand up a proxy that appends the key server-side and point baseApiUrl at it. This keeps the key out of client bundles while preserving elevated limits.

import {
  createClient,
  MAINNET_RELAY_API,
} from "@relayprotocol/relay-sdk";

createClient({
  baseApiUrl: "https://my-proxy.relay.link", // Replace with your proxy endpoint
  // ...other parameters
});

Keeping Your API key Secure

Treat your API key like a password. It’s tied to your account, controls your rate limits, and every request made with it is attributed to you.

If your key is leaked, anyone holding it can consume your rate limits or make requests on your behalf. Revoke and re-create the key in the Relay Dashboard immediately if you suspect it has been compromised.

Best practices: