{
  "openapi": "3.1.0",
  "info": {
    "title": "EduPulse API",
    "description": "Global education intelligence API \u2014 10 endpoints for students, test-takers, and lifelong learners worldwide. Study guide generation (any subject, any grade level, 190+ countries), adaptive quiz with explanations, concept explainer, backwards-planned study schedule (with Magoosh/Kaplan/Coursera exam prep links), authentic exam-style practice questions (GRE/GMAT/Bar/CPA/NCLEX/LSAT/MCAT/Series 7 and 200+ exams), flashcard sets for spaced repetition, exam format explainer, full mock exam simulation, misconception diagnosis (pinpoints the exact knowledge gap behind a wrong answer), and rubric-based exam grading with detailed feedback. All require x402 micropayment (USDC on Base).",
    "version": "1.2.0",
    "contact": {
      "url": "https://edupulse.vercel.app"
    }
  },
  "servers": [
    {
      "url": "https://edupulse.vercel.app"
    }
  ],
  "components": {
    "securitySchemes": {
      "x402": {
        "type": "apiKey",
        "in": "header",
        "name": "PAYMENT-SIGNATURE",
        "description": "x402 payment signature. Send without this header to receive a 402 with payment requirements. Sign and retry."
      }
    }
  },
  "security": [
    {
      "x402": []
    }
  ],
  "paths": {
    "/api/study/guide": {
      "get": {
        "summary": "Study guide generation \u2014 any subject, any grade, any country",
        "description": "Generates a complete, structured study guide for any topic at any grade level. Adapts to 190+ educational systems globally (US Common Core, UK National Curriculum, IB, French Baccalaur\u00e9at, etc.). Includes key concepts, worked examples, mnemonics, and exam tips. Supports ?lang= for response in any language.",
        "operationId": "studyGuide",
        "parameters": [
          {
            "name": "grade",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Grade level: K, 1-12"
          },
          {
            "name": "subject",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Subject (algebra, biology, chemistry, history, etc.)"
          },
          {
            "name": "topic",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Specific topic within the subject"
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Response language code (e.g. es, fr, zh, ja)"
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Study guide"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.1,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/study/quiz": {
      "get": {
        "summary": "Practice quiz with adaptive difficulty and answer explanations",
        "description": "Generates a practice quiz for any subject with MCQ, short answer, and true/false formats. Each answer includes a detailed explanation of why it is correct and why distractors are wrong. Adaptive difficulty: set ?level= from beginner to advanced. Global curriculum coverage.",
        "operationId": "studyQuiz",
        "parameters": [
          {
            "name": "grade",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subject",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topic",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "questions",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 5,
              "maximum": 15
            }
          },
          {
            "name": "difficulty",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "easy",
                "medium",
                "hard",
                "mixed"
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quiz with answer explanations"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.1,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/study/explain": {
      "get": {
        "summary": "Concept explainer \u2014 any topic at any level from 5th grade to PhD",
        "description": "Explains any concept at the requested level \u2014 from 'explain like I'm 12' to graduate-level rigor. Uses analogies, visual descriptions, real-world examples, and connects to related concepts. Essential for self-directed learners in any country.",
        "operationId": "studyExplain",
        "parameters": [
          {
            "name": "concept",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "grade",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audience",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "e.g. 'nursing student', 'Series 7 candidate', 'adult learner'"
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Concept explanation"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.05,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/study/schedule": {
      "get": {
        "summary": "Backwards-planned study schedule \u2014 from exam date to today, with daily tasks",
        "description": "Generates a complete backwards-planned study schedule from exam date to today. Breaks the syllabus into daily/weekly tasks, accounts for hours available per week, and includes milestone checkpoints. Response includes Magoosh/Kaplan exam prep links and Coursera/Udemy course links.",
        "operationId": "studySchedule",
        "parameters": [
          {
            "name": "exam",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "NCLEX",
                "Series-3",
                "Series-7",
                "CPA",
                "LSAT",
                "MCAT",
                "Bar",
                "PMP",
                "AWS-SAA",
                "CompTIA-Security-Plus",
                "USMLE-Step-1",
                "USMLE-Step-2",
                "SAT",
                "GRE",
                "GMAT"
              ]
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Exam date YYYY-MM-DD"
          },
          {
            "name": "hours_per_week",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 15
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Study schedule"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.1,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Response includes Magoosh/Kaplan and Coursera/Udemy links; pair with /api/exam/prep for practice questions alongside the schedule"
      }
    },
    "/api/exam/prep": {
      "get": {
        "summary": "Exam-style practice questions \u2014 200+ exams, rubric-matched difficulty",
        "description": "Generates authentic exam-style practice questions matched to official rubrics for 200+ exams: GRE, GMAT, Bar, CPA, CFA, NCLEX, LSAT, MCAT, Series 7/66, USMLE, IELTS, TOEFL, SAT, ACT, and more. Questions are exam-specific in format, difficulty, and style. Response includes Magoosh/Kaplan/Princeton Review affiliate links matched to exam type.",
        "operationId": "examPrep",
        "parameters": [
          {
            "name": "exam",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topic",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "questions",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 5,
              "maximum": 10
            }
          },
          {
            "name": "difficulty",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "easy",
                "medium",
                "hard"
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exam-style questions with rationales"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.15,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Response includes exam prep platform links matched to exam type; follow with /api/study/schedule for a complete study plan"
      }
    },
    "/api/exam/flashcards": {
      "get": {
        "summary": "Spaced-repetition flashcard set \u2014 import into Anki or Quizlet",
        "description": "Generates a structured flashcard set for any exam topic optimized for spaced repetition. Output is structured for easy import into Anki (.apkg format) or Quizlet. Includes front, back, and hint fields. Any subject, any exam, any language.",
        "operationId": "examFlashcards",
        "parameters": [
          {
            "name": "exam",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topic",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "section",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exam section (e.g. FAR for CPA)"
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10,
              "maximum": 20
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Flashcard set"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.08,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/exam/explain": {
      "get": {
        "summary": "Exam format explainer \u2014 complete breakdown of any exam structure and strategy",
        "description": "Complete breakdown of any exam: sections, timing, question types, scoring rubric, passing requirements, and score interpretation. Includes strategic advice (time allocation, question ordering, flagging strategy, partial credit rules). Works for any exam globally.",
        "operationId": "examExplain",
        "parameters": [
          {
            "name": "exam",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "question_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "e.g. NGN, logic-games, task-based-simulation, data-sufficiency"
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Format explainer with worked example"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.08,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/exam/mock": {
      "get": {
        "summary": "Full mock exam simulation \u2014 timed, scored, with performance report",
        "description": "Generates a full mock exam simulation with authentic question formats, timed sections, and a scored performance report. Identifies the candidate's strongest and weakest areas with targeted improvement recommendations. Response includes exam prep affiliate links for follow-up study.",
        "operationId": "examMock",
        "parameters": [
          {
            "name": "exam",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "duration",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 60
            },
            "description": "Duration in minutes"
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mock exam with answer key"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.25,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Response includes exam prep platform links matched to exam type; follow with /api/study/schedule for a complete study plan"
      }
    },
    "/api/study/misconception": {
      "get": {
        "operationId": "studyMisconception",
        "summary": "Misconception diagnosis \u2014 pinpoints the exact knowledge gap behind a wrong answer",
        "description": "Advanced learning diagnostic: given a student's wrong answer, identifies the specific misconception or knowledge gap that caused it \u2014 not just \"incorrect\" but exactly what the student believes that is wrong, why that belief formed, and how to correct it. Especially valuable for teachers, tutors, and adaptive learning systems. Works for any subject worldwide.",
        "parameters": [
          {
            "name": "question",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The exam/study question"
          },
          {
            "name": "answer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The student's wrong answer"
          },
          {
            "name": "subject",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "level",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Grade level or exam type"
          },
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Misconception analysis with root cause, correction, and targeted review materials"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.1,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/exam/grade": {
      "get": {
        "operationId": "examGrade",
        "summary": "Rubric-based exam grading \u2014 written response scoring with detailed feedback",
        "description": "Rubric-based grading for written exam responses: Bar exam essays (MEE, MPT, MBE performance tests), CPA BEC written communications, NCLEX SATA, LSAT analytical reasoning, GRE/GMAT essays, and law school exam answers. Returns a score with rubric breakdown, strength/weakness identification, and specific improvement suggestions. Covers all major professional and graduate-level written exams.",
        "parameters": [
          {
            "name": "exam",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exam type (e.g. Bar, CPA-BEC, GRE, LSAT)",
            "example": "Bar"
          },
          {
            "name": "question",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "response",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The student response to grade"
          },
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYMENT-SIGNATURE",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Graded response with score, rubric breakdown, and improvement feedback"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.25,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Response includes exam prep links; follow with /api/exam/prep for targeted practice on weak areas identified"
      }
    }
  }
}
