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.com
01

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-P6
3 "count": 5, // Required: 1-20
4 "stream": true, // Optional: SSE streaming (default: true)
5 "includeImages": false, // Optional: Generate images (default: true)
6 "strand": "number_and_algebra", // Optional filter
7 "difficulty": "medium" // Optional: easy, medium, hard
8}

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": false
8 }'

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_abc123

Response

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": 12345
17 }
18 }
19}

cURL Example

1curl https://api-v1.zyrooai.com/api/v1/ai-generator/questions/batch-uuid-here

Response

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": 5
10 }
11 }
12}

cURL Example

1curl https://api-v1.zyrooai.com/api/v1/ai-generator/syllabus/options

Response

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 input
2{
3 "inputType": "text",
4 "text": "What is 15 + 27?"
5}
6
7// Image input (use FormData)
8FormData {
9 inputType: "image",
10 imageFile: <File>
11}
12
13// Database selection
14{
15 "inputType": "database",
16 "questionId": "uuid-of-existing-question"
17}

cURL Example

1# Text input
2curl -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?"}'
5
6# Image input
7curl -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/analyze

Response

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": 300
25 }
26 }
27}

cURL Example

1curl -X POST https://api-v1.zyrooai.com/api/v1/isomorphic/source/source-uuid/analyze/stream

Response

1event: start
2data: {"sourceId": "uuid", "message": "Starting analysis"}
3
4event: progress
5data: {"step": "extracting", "message": "Extracting question content..."}
6
7event: progress
8data: {"step": "analyzing", "message": "AI analyzing question structure..."}
9
10event: done
11data: {"sourceId": "uuid", "analysis": {...}, "processingTimeMs": 5000}

cURL Example

1curl https://api-v1.zyrooai.com/api/v1/isomorphic/source/source-uuid

Response

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", // Required
3 "mode": "isomorphic", // "isomorphic" or "variant"
4 "count": 3, // 1-20
5 "targetGrade": "P3", // Optional override
6 "targetDifficulty": "medium", // Optional override
7 "stream": true // SSE streaming
8}

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": 3
7 }'

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": 1500
10 },
11 "processingTimeMs": 8000
12 }
13}

cURL Example

1curl https://api-v1.zyrooai.com/api/v1/isomorphic/batch/batch-uuid

Response

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, direct
medium2-3 steps
hardMulti-step, complex

Math Strands

number_and_algebra
measurement_and_geometry
statistics

Question Types

multiple_choicefill_in_blankshort_answerword_problemcalculationcomparisonpatternmeasurementgeometrydata_analysis
05

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 data
NOT_FOUNDResource not found
INTERNAL_ERRORServer error
DATABASE_ERRORDatabase operation failed
GENERATION_ERRORAI generation failed
Zyroo API Documentation
v1.0.0