API Reference
Making Requests
Fetch learning content and manage developer keys from the language your app is already built in.
Create the client
Create one SDK instance and reuse it. The default API base URL points to
https://api.chefuinc.com/api.
Create the SDK client
This preference follows you through all docs examples.
JavaScript / TypeScript
chefu-academy-sdk - npm
Initialize once in server-side code and reuse the SDK instance.
import CheFuAcademy from 'chefu-academy-sdk';
const sdk = new CheFuAcademy({
apiKey: process.env.CHEFU_API_KEY,
timeout: 10000,
});Courses API
Course methods return structured course data including chapters, lessons, quiz content, flashcards, and Q&A where available.
List coursesFetch public courses with optional filtering.
Search coursesSearch course titles, descriptions, and categories.
Featured coursesReturn featured or highly rated courses.
CategoriesList available course categories.
Course by IDRead one course by ID.
ChaptersReturn all chapters for a course.
LessonsReturn lessons inside one chapter.
QuizReturn quiz questions for a course.
FlashcardsReturn flashcards for practice mode.
Q&AReturn question-and-answer practice content.
Search courses and load practice content
Use list/search first, then fetch chapters, lessons, quizzes, flashcards, or Q&A by course ID.
JavaScript / TypeScript
chefu-academy-sdk - npm
const courses = await sdk.courses.search({
query: 'machine learning',
category: 'Technology',
limit: 10,
});
const course = await sdk.courses.getById(courses.courses[0].id);
const lessons = await sdk.courses.getLessons(course.id, 0);
const quiz = await sdk.courses.getQuiz(course.id);Videos API
Video methods include uploaded platform videos and videos stored with YouTube metadata.
List videosFetch uploaded and YouTube-backed videos.
Video by IDRead one video by ID.
Search videosSearch videos by title, description, or category.
Category videosReturn videos for one category.
Search and load videos
Video methods cover uploaded platform videos and YouTube-backed lessons.
JavaScript / TypeScript
chefu-academy-sdk - npm
const videos = await sdk.videos.search({
query: 'microchips',
category: 'Technology & Gadgets',
limit: 8,
});
const video = await sdk.videos.getById(videos.videos[0].id);
const related = await sdk.videos.getByCategory(video.category ?? 'Technology');API Keys
Key management methods require a user auth token. For most developers, the CLI is the easiest and safest way to create, list, and revoke keys.
Create keyCreate a developer API key using a user auth token.
List keysList keys for the authenticated developer.
Revoke keyRevoke a key by ID.
Create, list, and revoke keys
Key management requires a user auth token from login.
JavaScript / TypeScript
chefu-academy-sdk - npm
const session = await sdk.auth.login(email, password);
const created = await sdk.keys.create({
name: 'Production API',
});
const keys = await sdk.keys.list();
await sdk.keys.revoke(keys[0].id);Raw keys are shown once
Save the full chf_ key immediately after creation. Later list
responses show metadata, not the secret.
Response patterns
List methods return an object with the collection and a total.
1{
2courses: Course[],
3total: number
4}
5
6{
7videos: Video[],
8total: number
9}Single-resource methods return the requested resource or raise the SDK error type for the selected language when the request fails.