Documentation

Quickstart

Base URL: https://developers.kleequiz.com

Authentication

Send your API key in the HTTP Authorization header:

Authorization: Bearer kq_live_...

For security, API keys belong on your server. If you are building a browser or mobile app, send the user request to your backend first, then call KleeQuiz from there.

Generate a quiz

POST /v1/quizzes/generate accepts multipart/form-data.

FieldDescription
documentPDF or DOCX source file.
countNumber of questions. One successful generated question costs one credit.
question_typesComma-separated: multiple_choice, true_false, fill_blank, matching.
difficultyeasy, normal, or hard.
allow_type_substitutionIf true, the generator can substitute another selected/supported type when the document cannot safely support a requested slot.

Python

import requests

with open("notes.pdf", "rb") as f:
    response = requests.post(
        "https://developers.kleequiz.com/v1/quizzes/generate",
        headers={"Authorization": "Bearer " + API_KEY},
        files={"document": ("notes.pdf", f, "application/pdf")},
        data={"count": 10, "question_types": "multiple_choice,true_false,fill_blank"},
        timeout=300,
    )
response.raise_for_status()
quiz = response.json()

Node.js (server-side)

const form = new FormData();
form.append("document", new Blob([fileBytes]), "notes.pdf");
form.append("count", "10");
form.append("question_types", "multiple_choice,true_false");

const res = await fetch("https://developers.kleequiz.com/v1/quizzes/generate", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.KLEEQUIZ_API_KEY}` },
  body: form
});
const quiz = await res.json();

Account and capabilities