Developer Guide

Integrate Examozhi APIs

Add AI-powered curriculum search, summaries, question generation, and more to any app — in minutes.

Sub-100ms RAG search REST + JSON Any language Playground included

Quick Start

All API calls require an API key in the X-API-Key header. Get one from your dashboard.

Python

import requests

API_KEY = "sk_xxxx_your_key_here"
BASE = "https://examozhi.com/api/v1"

headers = {"X-API-Key": API_KEY}

# RAG search
resp = requests.post(f"{BASE}/ai/rag-search", headers=headers, json={
    "query": "Explain Newton's second law",
    "top_k": 5,
    "include_answer": True,
})
data = resp.json()
print(data["answer"])
print(data["sources"])

JavaScript / TypeScript

const API_KEY = "sk_xxxx_your_key_here";
const BASE = "https://examozhi.com/api/v1";

async function ragSearch(query) {
  const res = await fetch(`${BASE}/ai/rag-search`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-API-Key": API_KEY,
    },
    body: JSON.stringify({ query, top_k: 5, include_answer: true }),
  });
  const data = await res.json();
  console.log(data.answer);
  return data;
}

ragSearch("What is photosynthesis?");

Go

package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

const (
    apiKey = "sk_xxxx_your_key_here"
    base   = "https://examozhi.com/api/v1"
)

func ragSearch(query string) {
    body, _ := json.Marshal(map[string]any{
        "query":          query,
        "top_k":          5,
        "include_answer": true,
    })
    req, _ := http.NewRequest("POST", base+"/ai/rag-search", bytes.NewReader(body))
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("X-API-Key", apiKey)

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    var result map[string]any
    json.NewDecoder(resp.Body).Decode(&result)
    fmt.Println(result["answer"])
}

cURL

curl -X POST https://examozhi.com/api/v1/ai/rag-search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sk_xxxx_your_key_here" \
  -d '{
    "query": "Explain the water cycle",
    "top_k": 5,
    "include_answer": true
  }'

Authentication

Examozhi supports two auth methods:

API Key (recommended for backends)

Pass your key in the X-API-Key header. Keys can be scoped and rotated from your dashboard.

X-API-Key: sk_xxxx_...

JWT Bearer (for frontends)

Log in via POST /auth/login to get an access token, then pass it as a Bearer token.

Authorization: Bearer eyJhbGci...

API Endpoints

Working with content IDs. You never have to guess a UUID. Start with /ai/rag-search or /content/search — every result includes a content_id (and a source pointer). Feed that ID into /ai/summary or /content/items/{id}. In the Playground, each result has a one-click Copy ID button.

POST/ai/rag-search

Semantic search over the knowledge base with optional AI-generated answer.

{ "query": "string", "class_id?": "uuid", "subject_id?": "uuid", "edition?": "2024", "include_all_editions?": false, "top_k?": 5, "include_answer?": true }
POST/ai/summary

Summarize a chapter, content item, or arbitrary text. Pass text directly, or a content_id obtained from a /content/search or /ai/rag-search result.

{ "content_id?": "uuid", "chapter_id?": "uuid", "text?": "string", "max_length?": 300 }
POST/ai/explain

Get a beginner-friendly explanation of any topic.

{ "topic": "string", "difficulty_level?": 1-5, "style?": "simple|detailed" }
POST/ai/questions

Auto-generate quiz questions from a topic or content item.

{ "topic?": "string", "content_id?": "uuid", "question_type?": "mcq|short|long", "count?": 5 }
GET/content/classes

List all available classes (e.g., Class 8, Class 10 CBSE).

GET/content/subjects?class_id=

List subjects for a class. Add &current_only=true for live editions only, or &edition=2024 to pin a revision.

GET/content/chapters?subject_id=

List chapters under a subject.

POST/content/search

Full-text search through all content items.

{ "query": "string", "class_id?": "uuid", "edition?": "2024", "current_only?": false, "page?": 1 }
POST/content/enumerate

Complete, canonically-ordered enumeration over typed content — "list all poems", "all poem authors", "the first poem", "formulas in Chapter 3", "list all chapters/topics". No top-k cap; paginated. Derive intent from intent_query (language-agnostic), or pass subtype/attribute/ordinal explicitly.

{ "intent_query?": "string", "subtype?": "poem|formula|question|chapter|topic", "attribute?": "author", "class_id?": "uuid", "subject_id?": "uuid", "chapter_id?": "uuid", "language?": "ta", "edition?": "2024", "current_only?": true, "page?": 1, "page_size?": 100 }

Curriculum Versioning (Editions)

Textbooks are revised on multi-year cycles, and old and new editions often run side by side in classrooms. On Examozhi a subject is a textbook, and multiple editions of the same subject coexist — each with its own chapters, topics, and embeddings. One edition is flagged as current.

  • Default behavior: AI RAG search returns the current edition of every subject, so you always serve the live curriculum without doing anything.
  • Pin an edition: pass edition (e.g. "2024") on /ai/rag-search or /content/search to retrieve a specific revision — useful for students still on the older book.
  • Search everything: set include_all_editions: true (RAG) or current_only: false (text search) to span every edition at once.
  • Discover editions: GET /content/subjects?class_id=… returns each subject's edition, is_current, and effective_from so you can offer an edition switcher in your own UI.
# Serve the current edition (default)
POST /ai/rag-search { "query": "laws of motion", "class_id": "…" }

# Pin the 2018 revision for a class still using the old book
POST /ai/rag-search { "query": "laws of motion", "class_id": "…", "edition": "2018" }

Cross-Lingual Retrieval

Search in one script, retrieve in another. Romanized and code-mixed Indic queries — Tanglish and Hinglish likevanakkam orkabaddi — match native-script curriculum content, on top of the same hybrid (dense + sparse) retrieval that powers /ai/rag-search.

What you can do

  • Send romanized or code-mixed queries and get native-script results.
  • Steer retrieval and answers with language / response_language.
  • Multilingual coverage across Indian scripts — Tamil, Hindi, Telugu, and more.

No integration changes

  • Works through the existing /ai/rag-search contract — no new request fields required.
  • Fail-safe by design: if a stage is unavailable, retrieval falls back gracefully rather than erroring.
  • Rolling out in phases and continually improving — your integration stays stable throughout.

Try it from the Playground — set a target language and enter a romanized query to see cross-lingual retrieval in action.

Complete-Set Retrieval (Enumeration)

Some questions are set or ordinal operations, not similarity lookups — “list all the poems”, “show all poem authors”, “summarize the first poem”, “every formula in Chapter 3”. Semantic search answers these with a truncated top-k sample./content/enumerate answers them with the complete, canonically-ordered set (by chapter then position), paginated, with no top-k cap — so an AI agent or your UI gets the whole list, in order, every time.

Derive intent automatically

Pass a natural-language intent_query — the router detects enumeration / ordinal / attribute intent across all 10 supported languages (English, Tamil, Hindi, Telugu, Kannada, Malayalam, Bengali, Gujarati, Marathi, Urdu).

…or specify it explicitly

Set subtype (poem · formula · question · chapter · topic), attribute (e.g. author for the distinct, deduped set), or ordinal(1 = first, -1 = last). Scope with class/subject/chapter/edition/language.

Request & response

# "List all poems in the Tamil textbook" — complete, ordered set
curl -X POST https://examozhi.com/api/v1/content/enumerate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sk_xxxx_your_key" \
  -d '{ "intent_query": "list all poems", "subject_id": "…", "language": "ta" }'

# → {
#     "items": [ { "content_id": "…", "title": "…", "subtype": "poem",
#                  "attributes": { "author": "…" }, "chapter_title": "…",
#                  "page_number": 12, "source_ref": "…" }, … ],
#     "total": 20, "mode": "set", "page": 1, "page_size": 100
#   }
  • Modes (returned as mode): set (full list), attribute (distinct values, e.g. authors), ordinal (the Nth / first / last item), chapters, topics.
  • No truncation: total is the full match count; page through large sets with page / page_size.
  • Versioning aware: honors edition / current_only exactly like search.

Fail-safe by design. Enumeration runs over typed content metadata, populated automatically as content is ingested. When intent is ambiguous or the matched content isn't typed yet, the surface degrades to standard semantic search— never a wrong “none” answer. Through the agent gateway, theenumerate_curriculum tool returns these complete sets directly, while ordinary semantic questions andrag_answer stay unchanged.

The endpoint requires the same Content API entitlement as/content/search (included on every plan with core content access) and is subject to your plan's rate and monthly-quota limits below.

Rate Limits & Plans

PlanRequests / minMonthly limitAPI Keys
Free301,0002
Pro30050,00010
Enterprise3,000500,000100

Rate limit headers are returned on every response: X-RateLimit-Remaining-Minute and X-Monthly-Quota-Remaining.

Agent & MCP Integrations

Examozhi ships a native MCP server and a curated agent tool gateway on Pro and Enterprise plans — so AI agents (Claude, Cursor, Pydantic AI, Strands, LangGraph, or your own) can discover and call curriculum tools natively.

Native MCP (streamable HTTP)

Point any MCP client at the endpoint below, authenticated with your API key.

POST https://examozhi.com/api/v1/mcp

REST tool gateway

Prefer plain HTTP? Discover tools and invoke them directly.

GET https://examozhi.com/api/v1/agent/manifest

Connect an MCP client (initialize + list tools)

# 1) Handshake
curl -X POST https://examozhi.com/api/v1/mcp \
  -H "X-API-Key: sk_xxxx_your_key" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'

# 2) Discover tools
curl -X POST https://examozhi.com/api/v1/mcp \
  -H "X-API-Key: sk_xxxx_your_key" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'

# 3) Call a tool
curl -X POST https://examozhi.com/api/v1/mcp \
  -H "X-API-Key: sk_xxxx_your_key" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call",
       "params":{"name":"rag_answer","arguments":{"query":"Explain photosynthesis"}}}'

Available tools

search_curriculum

Semantic search across curriculum content

enumerate_curriculum

Complete ordered sets — list all poems, authors, first/last, formulas in a chapter

rag_answer

Grounded, cited answer to a question

explain_concept

Explain a concept at a chosen difficulty/style

generate_questions

Generate practice questions

list_curriculum_tree

List available classes for grounding

Error Reference

StatusMeaningAction
401Invalid or missing API keyCheck your X-API-Key header
403Insufficient planUpgrade your subscription
429Rate limit exceededBack off and retry; check X-RateLimit-Remaining-Minute
422Validation errorCheck request body — see detail field
500Server errorRetry with exponential backoff; contact support if persistent

Ready to build?

Create your free account and get an API key in under 60 seconds.