Skip to content

Commit

Permalink
Merge pull request #226 from okto-hq/minor-changes
Browse files Browse the repository at this point in the history
Add rate limit content
  • Loading branch information
oviawork authored Jan 30, 2025
2 parents 03a7072 + 5ee9e66 commit 0d247cc
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 5 deletions.
4 changes: 4 additions & 0 deletions app/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,7 @@ html {
background-color: #252630; /* dark mode hover background color */
color: #7C8FFF; /* dark mode hover text color */
}

#nd-docs-layout > aside > div:nth-of-type(2) > div > div > div > a > svg {
display: none;
}
4 changes: 3 additions & 1 deletion content/docs/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"quickstart",
"introduction-to-okto",
"developer-admin-dashboard",
"---SDKs---",
"---APIs and SDKs---",
"[Client APIs](https://docs.okto.tech/api-docs)",
"[Server APIs](https://docs.okto.tech/server-api-docs)",
"sdk-overview",
"react-sdk",
"flutter-sdk",
Expand Down
65 changes: 61 additions & 4 deletions content/docs/rate-limit.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,69 @@
---
title: Rate Limit
title: Rate Limits
description: To ensure fair usage and prevent abuse, the Okto SDK API enforces rate limits on requests.
full: false
---


<Callout>To ensure fair usage and prevent abuse, the Okto SDK API enforces rate limits on requests.</Callout>
## Production Rate Limits

## Overview
In the production environment, a rate limit is applied to all **<span style={{ color: 'green' }}>POST</span> orders**.

Rate limits define the maximum number of API requests allowed within a specific time period. If you exceed the limit, your requests may be throttled or temporarily blocked.
- **Request Limit**: 1,500 API calls per 5-minute window
- **Applies to**: All POST operations
- **Reset Period**: Every 5 minutes


### Error Response

When you exceed the rate limit, you'll receive the following error response:
```json
{
"status": "error",
"error": {
"code": 429,
"errorCode": "ER-TECH-0100",
"message": "Rate Limit Exceeded",
"trace_id": "678a3f1e00000000ced7e3483989507c"
}
}
```

As per industry standards, a **`retry-after` response header** will be included when a rate-exceeded error is encountered. The value of this header indicates the **time (in seconds)** after which the rate limit restriction will expire. You can retry your request after this period.


## Affected Endpoints

### Client Write APIs
- `POST /api/v1/transfer/tokens/execute`
- `POST /api/v1/nft/transfer`
- `POST /api/v1/readContractData`
- `POST /api/v1/rawtransaction/execute`

### Server Write APIs
- `POST /s2s/api/v1/wallet`
- `POST /s2s/api/v1/bulk-wallets`
- `POST /s2s/api/v2/nft/mint`
- `POST /s2s/api/v2/nft/transfer`
- `POST /s2s/api/v2/transfer/tokens/execute/{userId}`
- `POST /s2s/api/v1/readContractData`
- `POST /s2s/api/v1/rawtransaction/execute/{TW_USER_ID}`


### **How Rate Limiting Works**
The **five-minute interval** starts from the first API request each day.

For example:
- If the first request is sent at **12:02 am**, the rate limit applies from **12:02 am to 12:07 am**
- A maximum of 1,500 requests can be made within this period.
- The interval resets every five minutes.

---

## Sandbox Environment

The Sandbox environment has different rate limits to facilitate testing and development.

<Callout type="info">
Detailed Sandbox environment rate limits will be documented soon. Stay tuned for updates.
</Callout>

0 comments on commit 0d247cc

Please sign in to comment.