Relay
SupportGet in TouchTry Relay
Relay PlatformAPI ReferenceRelayKitRelay ProtocolChangelog

Getting Started

What is Relay?How Relay Works

Solutions

Payment Service ProvidersWallets & Wallet ProvidersMultichain AppsChainsCommerce & Payments

Use Cases

Bridging & OnboardingSwapsCall Execution

Features

App FeesFee SponsorshipDeposit AddressesGas Top-UpGasless ExecutionFast FillGasless SwapsPrice StabilizationRouting Integration Models

Security

Transaction ScreeningUnsupported ExchangesBug Bounty ProgramMEV protectionCommunity SupportContract Audits

Resources

Supported ChainsIntegrating using AISupportBrand Assets

API Reference

API OverviewQuickstartApps, API keys, and Rate LimitsAccess TokensUnderstanding Step ExecutionWallet DetectionCost & Fee StructureRefundsInput ValidationTrade TypesSurplus & ShortageHandling Quote ErrorsHandling Rate LimitsHandling Execution ErrorsContract CompatibilityBridging Integration GuideCall Execution Integration GuideTransaction IndexingBase Builder CodesSmart Accounts in RelayTestnet SupportSolana SupportBitcoin SupportHyperliquid SupportLighter SupportDeep LinkingWebsocketsWebhooksMigrating to Requests v3Migrating to Currencies v2Migrating to Token Price v2Supported ChainsContract AddressesSupported Tokens & RoutesTroubleshootingGet QuoteSubmit PermitGet StatusGet RequestsGet Published RequestsGet ChainsGet Chains LiquidityGet CurrenciesGet Currency ClassificationsGet Token PriceTransactions IndexTransactions SingleDeposit Address ReindexGet App Fee BalancesGet Balance EventsClaim App FeesGet UsageFast FillGet Swap SourcesCreate Access TokenExecute Gasless TxsAttest DepositGet Recovery BalancesRequest WithdrawalGet Withdrawal StatusGet Requests (v2)Get PriceGet ConfigGet Execution StatusGet Currencies (v1)Get Token Price (v1)Get Quote

RelayKit

OverviewInstallationcreateClientgetQuoteexecutegetAppFeesclaimAppFeesfastFillexecuteGaslessBatchAdaptersTypescript API TypingsChain UtilsInstallationuseQuoteuseRelayChainsuseRequestsuseTokenListuseTokenPriceuseExecutionStatusInstallationRelayKitProviderSwapWidgetThemingTroubleshooting

Protocol

Relay ProtocolHow It WorksThe Relay ChainDepositoryDeposit AddressesOracleHubAllocatorSecurity CouncilSecurity & AuditsFor AppsProgrammatic WithdrawalsWithdrawing with a SafeOperate a Third-Party Relay OracleAddressesEVM Depository ReferenceSVM Depository ReferenceOverviewArchitectureSecurityRelay Vaults BackendBridgingInteracting with Relay VaultsWithdrawing from Relay VaultsRelayPoolFactoryRelayPoolRelayPoolNativeGatewayRelayBridgeFactoryRelayBridge

Changelog

Changelog
## Documentation Index Fetch the complete documentation index at: https://docs.relay.link/llms.txt Use this file to discover all available pages before exploring further.
## Agent Instructions To quote bridges and swaps, look up chains and tokens, or track Relay transactions from an agent, use the Relay MCP server: npx -y @relayprotocol/relay-mcp. It is read-only and does not sign or broadcast transactions. Setup: https://docs.relay.link/resources/developing-with-ai.md For Relay Protocol's trust model, security architecture, and audits, see https://docs.relay.link/references/protocol/security.md. For address screening, see https://docs.relay.link/security/transaction-screening.md.

Access Tokens

Mint short-lived tokens so browser clients can call the Relay API without exposing your API key.

An access token is a short-lived credential that your backend mints (issues) from your API key and passes to a browser or mobile client. The client sends the token to Relay, so the API key never leaves your server. Each token expires after 15 minutes.

Use the table below to choose between an access token and the other ways to call Relay from a client.

ApproachAPI key locationWho calls RelayUse it when
API keyYour serverYour serverYour integration runs server to server
Proxy APIYour serverYour server, for each client requestYou want every request to pass through your backend
Access tokenYour serverThe client, with a tokenYou want the client to call Relay directly

Requirements

  1. An App with elevated rate limits — Only Apps with elevated rate limits can mint tokens. Request them through the support widget in the Relay Dashboard.
  2. A token endpoint on your backend — This endpoint holds the API key, mints tokens, and returns them to your client.

How to use it?

The flow has four steps:

  1. Your backend sends your API key to `POST /access-tokens`.
  2. Your backend returns the token to the client.
  3. The client sends the token in the Authorization header on supported Relay endpoints.
  4. When the token expires, the client requests a new token from your backend.

Mint a token on your backend

Send your API key in the `x-api-key` header with an empty JSON body.

// Route handler on your backend, for example POST /api/relay-token
export async function POST() {
  // 1. Mint a token with your API key (server-side only)
  const response = await fetch("https://api.relay.link/access-tokens", {
    method: "POST",
    headers: {
      "x-api-key": process.env.RELAY_API_KEY!,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  });
  if (!response.ok) {
    const { errorCode } = await response.json();
    return Response.json({ error: errorCode }, { status: response.status });
  }

  // 2. Return only the token and its expiry to your client
  const { token, expiresAt } = await response.json();
  return Response.json({ token, expiresAt });
}

The response has four fields:

FieldDescription
tokenThe token to send from the client
tokenTypeAlways Bearer
expiresAtWhen the token expires, as an ISO 8601 timestamp
scopeAlways public-api

The response has Cache-Control: no-store. Do not cache it.

Call Relay from the client

Send the token in the Authorization header over HTTPS.

// 1. Get a token from your backend, never the API key
const { token } = await fetch("/api/relay-token", { method: "POST" }).then(
  (r) => r.json()
);

// 2. Call Relay with the token
const quote = await fetch("https://api.relay.link/quote/v2", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${token}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    user: "WALLET_ADDRESS",
    originChainId: 8453,
    destinationChainId: 10,
    originCurrency: "0x0000000000000000000000000000000000000000",
    destinationCurrency: "0x0000000000000000000000000000000000000000",
    amount: "1000000000000000000",
    tradeType: "EXACT_INPUT",
  }),
});

Send an API key or a token in a request, not both. Relay rejects a request that has both.

What a token can do

Endpoint groupAllowed with a token
Quotes and pricesYes
Request statusYes
Request historyYes, public data only
Signed executionYes
Transaction submission and indexingYes
Chain, configuration, and currency lookupsYes
Fee sponsorship and fixed-rate parametersNo
Minting another tokenNo
Dashboard, admin, deposit address management, and all other endpointsNo

Make requests that use fee sponsorship or fixed rates from your backend with your API key. Enforce your sponsorship rules there.

With a token, request history returns public data only. It does not include the integrator-level read access that an API key can have.

Rate limits

Relay counts token requests for each API key and client IP address. All tokens from the same API key and the same IP share one allowance. More tokens do not increase it.

Request typeLimit per minute
Quotes10
Request status100
Request history100
Other supported endpoints60

Different IP addresses and different API keys have separate allowances. Minting is limited to 600 requests per minute for each API key. Failed mint attempts count toward that limit.

When a limit is reached, Relay returns 429 with the error code RATE_LIMITED. See Handling Rate Limits for how to recover.

Token lifecycle

EventWhat happensWhat to do
The token reaches 15 minutesRequests return 401Mint a new token through your backend
The client changes networkThe token keeps working. Its rate limit counts under the new IPNothing
You deactivate the API keyAll its tokens stop working after Relay's key cache refreshesMint tokens from an active key
You rotate the API key or change the App's settingsExisting tokens keep working until they expireNothing
You need to revoke one tokenRelay cannot revoke a single tokenDeactivate the API key to revoke all its tokens

Errors

The API also calls a token an API session, for example in the error code INVALID_API_SESSION.

StatusError codeMeaningWhat to do
400INVALID_REQUEST_PARAMSThe request used a parameter that tokens cannot use, for example fee sponsorshipSend that request from your backend with your API key
401INVALID_API_SESSIONThe token is invalid or expired, or its API key was deactivatedMint a new token through your backend
403FORBIDDENThe API key cannot mint tokens because its App does not have elevated rate limitsRequest elevated rate limits
429RATE_LIMITEDA rate limit was reachedWait and retry
500API_SESSION_UNAVAILABLEToken minting or validation is temporarily unavailableRetry with backoff

Caveats

  • A token works from any origin and IP address, because Relay checks the App's IP and origin restrictions only on the mint request. Restrict your App to your backend's IP addresses.
  • Protect your token endpoint against automated abuse. Anyone who can call it can get a token, so authenticate or throttle it.

This documentation is built and hosted on Mintlify, a developer documentation platform.

PreviousApps, API keys, and Rate LimitsNextUnderstanding Step Execution
Relay© 2026 Uneven Labs, Inc. All rights reserved.XGitHubSupport