| name | maintainx-rate-limits |
| description | Implement MaintainX API rate limiting, pagination, and backoff patterns.
Use when handling rate limit errors, implementing retry logic,
or optimizing API request throughput for MaintainX.
Trigger with phrases like "maintainx rate limit", "maintainx throttling",
"maintainx 429", "maintainx retry", "maintainx backoff", "maintainx pagination".
|
| allowed-tools | Read, Write, Edit |
| version | 1.11.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","maintainx","api"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
MaintainX Rate Limits
Overview
Handle MaintainX API rate limits gracefully with exponential backoff, cursor-based pagination, and request queuing to maximize throughput without triggering 429 errors.
Prerequisites
- MaintainX API access configured
- Node.js 18+ with
axios
- Understanding of async/await patterns
Instructions
Step 1: Rate-Limited Client Wrapper
import axios, { AxiosInstance, AxiosError } from 'axios';
export class RateLimitedClient {
private http: AxiosInstance;
private requestQueue: Array<() => void> = [];
private activeRequests = 0;
private maxConcurrent = 5;
private minDelayMs = 100;
constructor(apiKey?: string) {
const key = apiKey || process.env.MAINTAINX_API_KEY;
if (!key) throw new Error('MAINTAINX_API_KEY required');
this.http = axios.create({
baseURL: 'https://api.getmaintainx.com/v1',
: {
: ,
: ,
},
: ,
});
}
(): <> {
(. >= .) {
<>( ..(resolve));
}
.++;
( (r, .));
}
() {
.--;
next = ..();
(next) ();
}
request<T>(: , : , ?: , ?: ): <T> {
.();
{
response = .(
..<T>({ method, url, data, params }),
);
response.;
} {
.();
}
}
retryWithBackoff<T>(
: <T>,
maxRetries = ,
baseDelay = ,
): <T> {
( attempt = ; attempt <= maxRetries; attempt++) {
{
();
} (err) {
axiosErr = err ;
status = axiosErr.?.;
(status !== && !(status && status >= ) || attempt === maxRetries) {
err;
}
retryAfter = axiosErr.?.?.[];
delayMs = retryAfter
? (retryAfter) *
: baseDelay * .(, attempt) + .() * ;
.(
,
);
( (r, delayMs));
}
}
();
}
}