API Reference
Manage quizzes, submissions, and credits programmatically.
Introduction
The LookMyClass REST API lets you generate quizzes, manage submissions, and check credit balances from any application. All endpoints return JSON and follow predictable, resource-oriented conventions.
Before making API calls, generate an API key from your API Keys dashboard.
Authentication
All v1 API endpoints require authentication using a Bearer token in the Authorization header.
Authorization: Bearer lmc_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
- API keys start with
lmc_followed by 32 hex characters (36 chars total). - Keys are hashed server-side. The full key is shown only once on creation — store it securely.
- If a key is lost, delete it and create a new one from the API Keys dashboard.
- Keys carry the same privileges as your account — never embed them in client-side code.
Getting Your API Key
Go to Settings → API Keys → click New Key → copy the key. You must copy it immediately — it cannot be retrieved later.
Base URL & Versioning
https://lookmyclass.com/api/v1
All endpoints are prefixed with /api/v1/. The current version is v1. Future breaking changes will be released under a new version prefix (/api/v2/) without removing v1.
Rate Limits
API requests are rate-limited per API key:
All endpoints60 requests / minutePOST /quizzes (generation)10 requests / minuteWhen rate-limited, the API returns 429 Too Many Requests. Retry after theRetry-After header value (in seconds).
Errors
All errors return a consistent JSON body:
{
"error": "Human-readable message describing the problem.",
"code": "machine_readable_code",
"errors": { } // only present for validation errors (422)
}bad_requestInvalid or missing parameterunauthorizedMissing or invalid API keyinsufficient_creditsNot enough credits for this operationforbiddenAction not permitted (e.g., quiz not published)not_foundResource does not exist or belongs to another uservalidation_errorRequest body failed validationrate_limitedToo many requestsgeneration_errorAI provider returned an errorservice_unavailableAI provider API key not configuredModels Reference
Use these model IDs in provider + model fields when generating quizzes:
openaigpt-4oBest quality, higher costtext pdf imageopenaigpt-4o-miniFast, cheapest OpenAI optiontext pdf imageopenaigpt-4-turboOlder flagshiptext pdfopenaigpt-3.5-turboBudget optiontext pdfanthropicclaude-sonnet-4-6Best Claude balancetext pdf imageanthropicclaude-haiku-4-5-20251001Fastest, cheapest Claudetext pdf imageanthropicclaude-opus-4-6Most capable Claudetext pdf imageEstimate Cost
/api/v1/estimateCheck how many credits a quiz generation will cost before triggering it.
Query Parameters
model*string
Model ID from the Models Reference table.
mode*string
Generation mode: text, pdf, or image.
questionsinteger
Number of questions (default: 10).
imagesinteger
Number of images (only relevant for image mode, default: 0).
Example
curl -H "Authorization: Bearer lmc_..." \ "https://lookmyclass.com/api/v1/estimate?model=gpt-4o&mode=pdf&questions=20"
{
"credits": 43,
"model": "gpt-4o",
"mode": "pdf",
"questionCount": 20,
"imageCount": 0,
"note": "Estimated cost. Actual cost may vary slightly."
}Credits
/api/v1/creditsReturn your current credit balance.
curl -H "Authorization: Bearer lmc_..." \ "https://lookmyclass.com/api/v1/credits"
{ "balance": 250 }Quizzes
/api/v1/quizzesList all quizzes belonging to your account, newest first.
Query Parameters
pageinteger
Page number (default: 1).
pageSizeinteger
Results per page, max 100 (default: 20).
publishedboolean
Filter by published status: true or false.
{
"data": [
{
"id": "683a...",
"topic": "Photosynthesis",
"academicLevel": "Class 10 CBSE",
"totalQuestions": 20,
"easyCount": 6, "mediumCount": 10, "hardCount": 4,
"aiProvider": "openai",
"aiModel": "gpt-4o-mini",
"published": true,
"publicId": "3f7a1b2c-...",
"timerMinutes": 15,
"createdAt": "2026-05-29T10:00:00.000Z",
"updatedAt": "2026-05-29T10:01:00.000Z"
}
],
"pagination": { "total": 42, "page": 1, "pageSize": 20, "totalPages": 3 }
}/api/v1/quizzesGenerate a new quiz. Supports text (JSON), PDF, and image modes. Credits are deducted on success.
Text Mode — application/json
mode*string
Must be text (or omit — JSON defaults to text).
provider*string
openai or anthropic.
model*string
Model ID from Models Reference.
topic*string
Quiz topic (2–200 chars).
academicLevel*string
Target level, e.g. Class 10 CBSE (2–150 chars).
questionCount*integer
Number of questions (5–100).
difficulty*object
{ easy, medium, hard } — integers that sum to 100.
subTopicsstring
Optional sub-topic focus (max 500 chars).
timerMinutesinteger
Optional timer for public quiz (1–300).
curl -X POST "https://lookmyclass.com/api/v1/quizzes" \
-H "Authorization: Bearer lmc_..." \
-H "Content-Type: application/json" \
-d '{
"provider": "openai",
"model": "gpt-4o-mini",
"topic": "Newton\'s Laws of Motion",
"academicLevel": "Class 11 CBSE",
"questionCount": 10,
"difficulty": { "easy": 30, "medium": 50, "hard": 20 }
}'PDF Mode — multipart/form-data
curl -X POST "https://lookmyclass.com/api/v1/quizzes" \ -H "Authorization: Bearer lmc_..." \ -F "mode=pdf" \ -F "provider=openai" \ -F "model=gpt-4o" \ -F "topic=Chapter 3" \ -F "academicLevel=Undergraduate" \ -F "questionCount=15" \ -F "difficulty[easy]=25" \ -F "difficulty[medium]=50" \ -F "difficulty[hard]=25" \ -F "pdf=@chapter3.pdf"
Image Mode — multipart/form-data
curl -X POST "https://lookmyclass.com/api/v1/quizzes" \ -H "Authorization: Bearer lmc_..." \ -F "mode=image" \ -F "provider=anthropic" \ -F "model=claude-sonnet-4-6" \ -F "topic=Diagram Analysis" \ -F "academicLevel=JEE Main" \ -F "questionCount=10" \ -F "difficulty[easy]=20" \ -F "difficulty[medium]=60" \ -F "difficulty[hard]=20" \ -F "images[]=@diagram1.png" \ -F "images[]=@diagram2.jpg"
Response (201)
{
"data": {
"id": "683a...",
"topic": "Newton's Laws of Motion",
"questions": [
{
"id": 1,
"question": "Which law explains why a rocket accelerates?",
"options": ["First law", "Second law", "Third law", "Zeroth law"],
"correctAnswer": 2,
"explanation": "Newton's third law: for every action there is an equal and opposite reaction.",
"difficulty": "medium"
}
],
...
},
"creditsDeducted": 12
}/api/v1/quizzes/:idRetrieve a single quiz including all questions.
curl -H "Authorization: Bearer lmc_..." \ "https://lookmyclass.com/api/v1/quizzes/683a1b2c3d4e5f6a7b8c9d0e"
/api/v1/quizzes/:idUpdate a quiz. Publish/unpublish it or change the timer. A publicId is generated automatically on first publish.
publishedboolean
Set to true to publish, false to unpublish.
timerMinutesinteger
Set or update timer (1–300). Pass null to remove.
curl -X PATCH "https://lookmyclass.com/api/v1/quizzes/683a..." \
-H "Authorization: Bearer lmc_..." \
-H "Content-Type: application/json" \
-d '{ "published": true, "timerMinutes": 20 }'/api/v1/quizzes/:idPermanently delete a quiz and all its submissions.
curl -X DELETE "https://lookmyclass.com/api/v1/quizzes/683a..." \ -H "Authorization: Bearer lmc_..."
{ "ok": true }Submissions
/api/v1/submissionsList all quiz attempts across your quizzes, newest first. Includes computed score for submitted attempts.
pageinteger
Page number (default: 1).
pageSizeinteger
Results per page, max 100 (default: 20).
quizIdstring
Filter by a specific quiz ID.
{
"data": [
{
"id": "684b...",
"quizId": "683a...",
"sessionKey": "uuid-v4",
"studentName": "Priya Sharma",
"studentClass": "10-A",
"studentRollId": "42",
"startedAt": "2026-05-29T11:00:00.000Z",
"submittedAt": "2026-05-29T11:14:22.000Z",
"score": { "correct": 14, "total": 20, "percentage": 70 }
}
],
"pagination": { "total": 85, "page": 1, "pageSize": 20, "totalPages": 5 }
}/api/v1/submissionsProgrammatically submit a student's answers for a published quiz. The quiz must be published and belong to your account.
quizPublicId*string
The publicId of the published quiz.
studentName*string
Student full name (max 100 chars).
studentClass*string
Class/section identifier (max 100 chars).
studentRollId*string
Roll number or student ID (max 100 chars).
answersobject
Map of question index (string) → selected option index (0–3). If omitted, creates an unsubmitted attempt.
curl -X POST "https://lookmyclass.com/api/v1/submissions" \
-H "Authorization: Bearer lmc_..." \
-H "Content-Type: application/json" \
-d '{
"quizPublicId": "3f7a1b2c-...",
"studentName": "Priya Sharma",
"studentClass": "10-A",
"studentRollId": "42",
"answers": { "0": 2, "1": 0, "2": 3, "3": 1 }
}'{
"data": {
"id": "684b...",
"quizId": "683a...",
"sessionKey": "auto-generated-uuid",
"studentName": "Priya Sharma",
"studentClass": "10-A",
"studentRollId": "42",
"startedAt": "2026-05-29T11:00:00.000Z",
"submittedAt": "2026-05-29T11:00:00.000Z",
"score": { "correct": 3, "total": 4, "percentage": 75 }
}
}/api/v1/submissions/:idGet a single submission including the raw answers map and computed score.
curl -H "Authorization: Bearer lmc_..." \ "https://lookmyclass.com/api/v1/submissions/684b1c2d3e4f5a6b7c8d9e0f"
/api/v1/submissions/:idPermanently delete a single submission.
curl -X DELETE "https://lookmyclass.com/api/v1/submissions/684b..." \ -H "Authorization: Bearer lmc_..."
{ "ok": true }