v1.0.0
Zyroo API
Complete reference for the Zyroo AI Question Generator API. All endpoints support JSON request/response format.
Base URL
https://api-v1.zyrooai.com01
Quick Start
Generate your first batch of questions in seconds
1# Generate 5 questions for Primary 3 (streaming mode)2curl -X POST https://api-v1.zyrooai.com/api/v1/ai-generator/questions/generate \3 -H "Content-Type: application/json" \4 -d '{"grade": "P3", "count": 5}'02
AI Question Generator
Endpoints for generating Singapore Math curriculum-aligned questions
Request Body
1{2 "grade": "P3", // Required: P1-P63 "count": 5, // Required: 1-204 "stream": true, // Optional: SSE streaming (default: true)5 "includeImages": false, // Optional: Generate images (default: true)6 "strand": "number_and_algebra", // Optional filter7 "difficulty": "medium" // Optional: easy, medium, hard8}cURL Example
1curl -X POST https://api-v1.zyrooai.com/api/v1/ai-generator/questions/generate \2 -H "Content-Type: application/json" \3 -d '{4 "grade": "P3",5 "count": 5,6 "stream": false,7 "includeImages": false8 }'Response
1// Background task mode (stream: false)2{3 "success": true,4 "data": {5 "taskId": "run_abc123",6 "status": "pending",7 "checkUrl": "/api/v1/ai-generator/questions/tasks/run_abc123"8 }9}cURL Example
1curl https://api-v1.zyrooai.com/api/v1/ai-generator/questions/tasks/run_abc123Response
1{2 "success": true,3 "data": {4 "taskId": "run_abc123",5 "status": "completed",6 "progress": {7 "step": "complete",8 "message": "Generation complete",9 "questionsProcessed": 5,10 "batchId": "uuid-here"11 },12 "result": {13 "batchId": "uuid-here",14 "generatedCount": 5,15 "questionIds": ["uuid1", "uuid2", ...],16 "processingTimeMs": 1234517 }18 }19}cURL Example
1curl https://api-v1.zyrooai.com/api/v1/ai-generator/questions/batch-uuid-hereResponse
1{2 "success": true,3 "data": {4 "batch": {5 "id": "batch-uuid",6 "grade": "P3",7 "requestedCount": 5,8 "generatedCount": 5,9 "status": "completed"10 },11 "questions": [12 {13 "id": "question-uuid",14 "type": "multiple_choice",15 "difficulty": "medium",16 "stem": "What is 15 + 27?",17 "options": [18 {"key": "A", "text": "32"},19 {"key": "B", "text": "42"},20 {"key": "C", "text": "52"},21 {"key": "D", "text": "62"}22 ],23 "answer": "B",24 "explanation": "15 + 27 = 42",25 "tags": ["addition", "two-digit"],26 "skills": ["mental math"]27 }28 ]29 }30}cURL Example
1curl "https://api-v1.zyrooai.com/api/v1/ai-generator/batches?page=1&pageSize=10&grade=P3"Response
1{2 "success": true,3 "data": {4 "batches": [...],5 "pagination": {6 "page": 1,7 "pageSize": 10,8 "total": 50,9 "totalPages": 510 }11 }12}cURL Example
1curl https://api-v1.zyrooai.com/api/v1/ai-generator/syllabus/optionsResponse
1{2 "success": true,3 "data": {4 "grades": ["P1", "P2", "P3", "P4", "P5", "P6"],5 "strands": ["number_and_algebra", "measurement_and_geometry", "statistics"],6 "topics": ["Whole Numbers", "Fractions", "Decimals", ...]7 }8}03
Isomorphic Generator
Generate similar or variant questions based on a source question
Request Body
1// Text input2{3 "inputType": "text",4 "text": "What is 15 + 27?"5}67// Image input (use FormData)8FormData {9 inputType: "image",10 imageFile: <File>11}1213// Database selection14{15 "inputType": "database",16 "questionId": "uuid-of-existing-question"17}cURL Example
1# Text input2curl -X POST https://api-v1.zyrooai.com/api/v1/isomorphic/source \3 -H "Content-Type: application/json" \4 -d '{"inputType": "text", "text": "What is 15 + 27?"}'56# Image input7curl -X POST https://api-v1.zyrooai.com/api/v1/isomorphic/source \8 -F "inputType=image" \9 -F "imageFile=@question.png"Response
1{2 "success": true,3 "data": {4 "sourceId": "source-uuid-here"5 }6}cURL Example
1curl -X POST https://api-v1.zyrooai.com/api/v1/isomorphic/source/source-uuid/analyzeResponse
1{2 "success": true,3 "data": {4 "sourceId": "source-uuid",5 "analysis": {6 "detectedGrade": "P3",7 "detectedStrand": "number_and_algebra",8 "detectedSubStrand": "Whole Numbers",9 "detectedTopic": "Addition",10 "detectedType": "short_answer",11 "detectedDifficulty": "easy",12 "mathematicalStructure": {13 "operation": "addition",14 "steps": 1,15 "involves": ["two-digit numbers"]16 },17 "knowledgePoint": "Addition of two 2-digit numbers",18 "normalizedStem": "What is 15 + 27?",19 "normalizedAnswer": "42"20 },21 "syllabusItems": [...],22 "usage": {23 "inputTokens": 1500,24 "outputTokens": 30025 }26 }27}cURL Example
1curl -X POST https://api-v1.zyrooai.com/api/v1/isomorphic/source/source-uuid/analyze/streamResponse
1event: start2data: {"sourceId": "uuid", "message": "Starting analysis"}34event: progress5data: {"step": "extracting", "message": "Extracting question content..."}67event: progress8data: {"step": "analyzing", "message": "AI analyzing question structure..."}910event: done11data: {"sourceId": "uuid", "analysis": {...}, "processingTimeMs": 5000}cURL Example
1curl https://api-v1.zyrooai.com/api/v1/isomorphic/source/source-uuidResponse
1{2 "success": true,3 "data": {4 "source": {5 "id": "source-uuid",6 "inputType": "text",7 "rawText": "What is 15 + 27?",8 "detectedGrade": "P3",9 "detectedStrand": "number_and_algebra",10 "normalizedStem": "What is 15 + 27?",11 "createdAt": "2024-01-01T00:00:00Z"12 }13 }14}Request Body
1{2 "sourceId": "source-uuid", // Required3 "mode": "isomorphic", // "isomorphic" or "variant"4 "count": 3, // 1-205 "targetGrade": "P3", // Optional override6 "targetDifficulty": "medium", // Optional override7 "stream": true // SSE streaming8}cURL Example
1curl -X POST https://api-v1.zyrooai.com/api/v1/isomorphic/generate \2 -H "Content-Type: application/json" \3 -d '{4 "sourceId": "source-uuid",5 "mode": "isomorphic",6 "count": 37 }'Response
1{2 "success": true,3 "data": {4 "batchId": "batch-uuid",5 "generatedCount": 3,6 "questionIds": ["q1", "q2", "q3"],7 "usage": {8 "inputTokens": 2000,9 "outputTokens": 150010 },11 "processingTimeMs": 800012 }13}cURL Example
1curl https://api-v1.zyrooai.com/api/v1/isomorphic/batch/batch-uuidResponse
1{2 "success": true,3 "data": {4 "batch": {...},5 "questions": [6 {7 "id": "q1",8 "stem": "What is 23 + 18?",9 "answer": "41",10 "similarityType": "isomorphic",11 "relationToOriginal": "Same operation with different numbers"12 }13 ]14 }15}04
Data Types
Common data structures used across the API
Grade Levels
P1P2P3P4P5P6
Primary 1-6 (Singapore education system)
Difficulty Levels
easySingle-step, directmedium2-3 stepshardMulti-step, complexMath Strands
number_and_algebrameasurement_and_geometrystatisticsQuestion Types
multiple_choicefill_in_blankshort_answerword_problemcalculationcomparisonpatternmeasurementgeometrydata_analysis05
Error Handling
All errors follow a consistent format
1{2 "success": false,3 "error": {4 "code": "VALIDATION_ERROR",5 "message": "grade is required"6 }7}Common Error Codes
VALIDATION_ERRORInvalid input dataNOT_FOUNDResource not foundINTERNAL_ERRORServer errorDATABASE_ERRORDatabase operation failedGENERATION_ERRORAI generation failed