CF
Start

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.

Language example

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.

server.ts
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 courses

Fetch public courses with optional filtering.

Search courses

Search course titles, descriptions, and categories.

Featured courses

Return featured or highly rated courses.

Categories

List available course categories.

Course by ID

Read one course by ID.

Chapters

Return all chapters for a course.

Lessons

Return lessons inside one chapter.

Quiz

Return quiz questions for a course.

Flashcards

Return flashcards for practice mode.

Q&A

Return question-and-answer practice content.

Language example

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

courses.ts
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 videos

Fetch uploaded and YouTube-backed videos.

Video by ID

Read one video by ID.

Search videos

Search videos by title, description, or category.

Category videos

Return videos for one category.

Language example

Search and load videos

Video methods cover uploaded platform videos and YouTube-backed lessons.

JavaScript / TypeScript

chefu-academy-sdk - npm

videos.ts
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 key

Create a developer API key using a user auth token.

List keys

List keys for the authenticated developer.

Revoke key

Revoke a key by ID.

Language example

Create, list, and revoke keys

Key management requires a user auth token from login.

JavaScript / TypeScript

chefu-academy-sdk - npm

keys.ts
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.

List response
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.