Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions references/api/api-keys.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
title: "API keys and Rate Limits"
description: "Create API keys in the Relay Dashboard to authenticate requests and raise your rate limits"
description: "Create API keys in the Relay Dashboard to authenticate requests and manage your 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](https://dashboard.relay.link) — create new keys, rotate existing ones, and inspect individual requests.
Relay enforces rate limits to keep the platform reliable for every integrator. You manage API keys in the [Relay Dashboard](https://dashboard.relay.link) — create new API keys, rotate existing ones, and inspect individual requests. Default limits listed below apply to self-serve API keys.

## Creating an API key

Expand All @@ -30,9 +28,9 @@ The [Relay Dashboard](https://dashboard.relay.link) is also where you observe wh

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)
## Default Rate Limits

The following limits apply to unauthenticated requests:
The following limits apply per API key:

| Endpoint | Limit |
| ---------------------- | ----------------------- |
Expand All @@ -41,9 +39,9 @@ The following limits apply to unauthenticated requests:
| `/transactions/status` | 200 requests per minute |
| Other endpoints | 200 requests per minute |

## API key Rate Limits
## Elevated Rate Limits

Authenticated requests get higher limits, applied per key:
Higher limits are available on request, applied per key:

| Endpoint | Limit |
| ---------------------- | ----------------------- |
Expand All @@ -52,13 +50,13 @@ Authenticated requests get higher limits, applied per key:
| `/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.
To request higher limits, get in touch through the support widget in the [Relay Dashboard](https://dashboard.relay.link).

## How to Use an API key

### HTTP requests

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

```
x-api-key: YOUR_API_KEY
Expand Down Expand Up @@ -97,7 +95,7 @@ const quote = await getClient()?.actions.getQuote(quoteParams, undefined, {

### 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.
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 your key's rate limits.

```typescript
import {
Expand Down
4 changes: 1 addition & 3 deletions references/api/api_guides/websockets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@ Refer to the guide below on how to integrate the websocket into your application

## **Authentication**

The Websocket Service is available for anyone with strict rate limits. For customers with an API key it can be used for authentication for higher rate limits, the service is available at the following URL `wss://ws.relay.link`
The Websocket Service uses an API key for authentication and is available at the following URL `wss://ws.relay.link`

To connect using an API key, provide your API key as a query param in the connection url:

```
const wss = new ws(`wss://ws.relay.link?apiKey=${YOUR_API_KEY}`);
```

<Tip>Authentication is generally not required in client-side applications.</Tip>

<Warning>
**The websocket server needs to restart to deploy updates**

Expand Down
2 changes: 1 addition & 1 deletion references/api/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Follow this 5-step flow to integrate Relay into your application:

<Callout icon="key" color="#4615C8">
### API key Provisioning
Create an API key in the [Relay Dashboard](https://dashboard.relay.link) to raise your rate limits. <br/>
Create an API key in the [Relay Dashboard](https://dashboard.relay.link). <br/>
See [API keys and Rate Limits](/references/api/api-keys) for usage and limits.
</Callout>

Expand Down
2 changes: 1 addition & 1 deletion snippets/GetAnApiKey.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Tip>
Create an API key in the [Relay Dashboard](https://dashboard.relay.link) to raise your rate limits.
Create an API key in the [Relay Dashboard](https://dashboard.relay.link).
</Tip>
Loading