REST API v1

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.

HTTP
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

Base URL
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 / minute
POST /quizzes (generation)10 requests / minute

When 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:

JSON
{
  "error": "Human-readable message describing the problem.",
  "code":  "machine_readable_code",
  "errors": { }  // only present for validation errors (422)
}
400bad_requestInvalid or missing parameter
401unauthorizedMissing or invalid API key
402insufficient_creditsNot enough credits for this operation
403forbiddenAction not permitted (e.g., quiz not published)
404not_foundResource does not exist or belongs to another user
422validation_errorRequest body failed validation
429rate_limitedToo many requests
502generation_errorAI provider returned an error
503service_unavailableAI provider API key not configured

Models Reference

Use these model IDs in provider + model fields when generating quizzes:

providermodelNotesModes
openaigpt-4oBest quality, higher costtext pdf image
openaigpt-4o-miniFast, cheapest OpenAI optiontext pdf image
openaigpt-4-turboOlder flagshiptext pdf
openaigpt-3.5-turboBudget optiontext pdf
anthropicclaude-sonnet-4-6Best Claude balancetext pdf image
anthropicclaude-haiku-4-5-20251001Fastest, cheapest Claudetext pdf image
anthropicclaude-opus-4-6Most capable Claudetext pdf image

Estimate Cost

GET/api/v1/estimate

Check 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.

questions
integer

Number of questions (default: 10).

images
integer

Number of images (only relevant for image mode, default: 0).

Example

curl
curl -H "Authorization: Bearer lmc_..." \
  "https://lookmyclass.com/api/v1/estimate?model=gpt-4o&mode=pdf&questions=20"
Response
{
  "credits": 43,
  "model": "gpt-4o",
  "mode": "pdf",
  "questionCount": 20,
  "imageCount": 0,
  "note": "Estimated cost. Actual cost may vary slightly."
}

Credits

GET/api/v1/credits

Return your current credit balance.

curl
curl -H "Authorization: Bearer lmc_..." \
  "https://lookmyclass.com/api/v1/credits"
Response
{ "balance": 250 }

Quizzes

GET/api/v1/quizzes

List all quizzes belonging to your account, newest first.

Query Parameters

page
integer

Page number (default: 1).

pageSize
integer

Results per page, max 100 (default: 20).

published
boolean

Filter by published status: true or false.

Response
{
  "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 }
}
POST/api/v1/quizzes

Generate 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.

subTopics
string

Optional sub-topic focus (max 500 chars).

timerMinutes
integer

Optional timer for public quiz (1–300).

curl
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
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
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)

JSON
{
  "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
}
GET/api/v1/quizzes/:id

Retrieve a single quiz including all questions.

curl
curl -H "Authorization: Bearer lmc_..." \
  "https://lookmyclass.com/api/v1/quizzes/683a1b2c3d4e5f6a7b8c9d0e"
PATCH/api/v1/quizzes/:id

Update a quiz. Publish/unpublish it or change the timer. A publicId is generated automatically on first publish.

published
boolean

Set to true to publish, false to unpublish.

timerMinutes
integer

Set or update timer (1–300). Pass null to remove.

curl
curl -X PATCH "https://lookmyclass.com/api/v1/quizzes/683a..." \
  -H "Authorization: Bearer lmc_..." \
  -H "Content-Type: application/json" \
  -d '{ "published": true, "timerMinutes": 20 }'
DELETE/api/v1/quizzes/:id

Permanently delete a quiz and all its submissions.

curl
curl -X DELETE "https://lookmyclass.com/api/v1/quizzes/683a..." \
  -H "Authorization: Bearer lmc_..."
Response
{ "ok": true }

Submissions

GET/api/v1/submissions

List all quiz attempts across your quizzes, newest first. Includes computed score for submitted attempts.

page
integer

Page number (default: 1).

pageSize
integer

Results per page, max 100 (default: 20).

quizId
string

Filter by a specific quiz ID.

Response
{
  "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 }
}
POST/api/v1/submissions

Programmatically 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).

answers
object

Map of question index (string) → selected option index (0–3). If omitted, creates an unsubmitted attempt.

curl
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 }
  }'
Response (201)
{
  "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 }
  }
}
GET/api/v1/submissions/:id

Get a single submission including the raw answers map and computed score.

curl
curl -H "Authorization: Bearer lmc_..." \
  "https://lookmyclass.com/api/v1/submissions/684b1c2d3e4f5a6b7c8d9e0f"
DELETE/api/v1/submissions/:id

Permanently delete a single submission.

curl
curl -X DELETE "https://lookmyclass.com/api/v1/submissions/684b..." \
  -H "Authorization: Bearer lmc_..."
Response
{ "ok": true }

© 2026 Akdron Consultancy Pvt Ltd. All rights reserved.