Rate Limiting
All RGS API endpoints are rate-limited per IP address using a token bucket algorithm. Exceeding the limit returns HTTP 429 Too Many Requests.
Limits
| Endpoint | Sustained (req/s) | Burst |
|---|---|---|
/operator/launch |
50 | 20 |
/operator/games |
50 | 20 |
/operator/currencies |
50 | 20 |
These limits are per IP address. If your backend proxies player requests, all players behind that proxy share the same budget.
429 Response
When rate-limited, the response includes a Retry-After header indicating when to retry (in seconds).
{
"status": 429,
"title": "Too Many Requests",
"code": "rate_limit_exceeded"
}
Handling Rate Limits
Implement exponential backoff when you receive a 429 response.
# cURL does not retry automatically — check the status code in scripts
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST https://rgs.example.com/operator/launch \
-H "Content-Type: application/json" \
-H "X-Operator-ID: $OPERATOR_ID" \
-H "X-Timestamp: $TIMESTAMP" \
-H "X-HMAC-SHA256: $SIG" \
-d "$BODY")
if [ "$STATUS" = "429" ]; then
echo "Rate limited — retry after backoff"
sleep 1
fi
async function callRGS(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
const resp = await fetch(url, options);
if (resp.status !== 429) return resp;
const delay = Math.pow(2, i) * 1000;
await new Promise((r) => setTimeout(r, delay));
}
throw new Error("Rate limited after retries");
}
func callRGS(req *http.Request, maxRetries int) (*http.Response, error) {
for i := range maxRetries {
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}
if resp.StatusCode != http.StatusTooManyRequests {
return resp, nil
}
resp.Body.Close()
time.Sleep(time.Duration(1<<i) * time.Second)
}
return nil, fmt.Errorf("rate limited after %d retries", maxRetries)
}
import time, requests
def call_rgs(method, url, max_retries=3, **kwargs):
for i in range(max_retries):
resp = requests.request(method, url, **kwargs)
if resp.status_code != 429:
return resp
time.sleep(2 ** i)
raise Exception("Rate limited after retries")