Developer mode

ChronoLens API Docs

ChronoLens uses the query you send. Without OpenAI it returns a minimal contextual workspace plus any live source-adapter results; with OpenAI it enriches the workspace once and caches it in memory.

POST /api/workspaces

Create a workspace from a topic, mode, lens, optional sources, and optional uploaded image data URL.

GET /api/workspaces/[id]

Return a workspace from the in-memory store.

POST /api/search-sources

Search OpenAlex, Library of Congress, the Met, and other optional source adapters.

POST /api/generate-study

Generate a standalone StudyModule for the Study page.

POST /api/generate-lesson

Generate a standalone LessonPack for the Teach page.

GET /api/latest-discoveries

Return recent research/source-watch items with contextual fallback.

POST /api/workspaces/[id]/image-analysis

Return deterministic visual regions for Image Lab.

POST /api/workspaces/[id]/analyze-region

Analyze a user-selected image region with optional OpenAI fallback-safe interpretation.

POST /api/workspaces/[id]/ai-enrich

Manually run optional OpenAI enrichment if configured.

POST /api/workspaces/[id]/lesson

Regenerate a lesson pack.

POST /api/workspaces/[id]/study

Regenerate a study module.

Example request / response

{
  "query": "Teach me about Islamic geometric patterns in architecture.",
  "mode": "student",
  "lensType": "topic"
}
{
  "id": "workspace-islamic-geometric-patterns-in-architecture-...",
  "title": "Islamic geometric patterns in architecture",
  "status": {
    "sourcesLoaded": 0,
    "evidenceCards": 0,
    "connectionsMapped": 0,
    "lessonReady": true,
    "aiMode": "enriched"
  }
}