Reliability
Rate Limits & Usage
Build integrations that are fast, respectful of shared resources, and resilient during traffic spikes.
Overview
CheFu Academy may throttle traffic to protect platform stability. If a
client sends too many requests, the API can respond with
429 Too Many Requests.
Limits can vary by plan and endpoint
Design your app to handle 429 even when you do not normally
reach the limit during development.
Reduce requests
- Reuse one SDK instance instead of recreating it for every call.
Use
limitto request only the data you need.- Cache categories, featured courses, and stable video lists.
- Fetch detailed course content only after a user opens a course.
Avoid sending a search request on every keystroke without debouncing.
Retry strategy
Retry safe read operations with a small delay and backoff. Do not retry key creation blindly.
Retry safe read operations
Retry idempotent reads such as course and video lookups.
JavaScript / TypeScript
chefu-academy-sdk - npm
async function withRetry<T>(request: () => Promise<T>, retries = 2): Promise<T> {
try {
return await request();
} catch (error) {
const statusCode = error instanceof Error && 'statusCode' in error
? Number(error.statusCode)
: undefined;
if ((statusCode === 429 || statusCode >= 500) && retries > 0) {
await new Promise((resolve) => setTimeout(resolve, 800 * (3 - retries)));
return withRetry(request, retries - 1);
}
throw error;
}
}
const courses = await withRetry(() => sdk.courses.getFeatured({ limit: 6 }));Caching
For Next.js apps, keep SDK calls server-side and use framework caching around route handlers or Server Components.
1export const revalidate = 300;
2
3export async function GET() {
4const courses = await sdk.courses.getFeatured({ limit: 6 });
5return Response.json(courses);
6}