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.
| Field | Description |
|---|---|
document | PDF or DOCX source file. |
count | Number of questions. One successful generated question costs one credit. |
question_types | Comma-separated: multiple_choice, true_false, fill_blank, matching. |
difficulty | easy, normal, or hard. |
allow_type_substitution | If 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
GET /v1/account— balance and account details.GET /v1/capabilities— supported files, question types, and request limits.GET /healthz— service health.