Coptic Compass Grammar + Shenute AI Docs
Explore the public grammar dataset in Swagger and integrate Shenute AI with provider selection and OCR-backed image context.
Public consumers should usually start with /api/v1/grammar for discovery or /api/openapi.json for tooling. The public dataset only exposes published lessons and their related records. Shenute AI is available through /api/shenute, with openrouter as the default provider when no explicit provider is supplied. OCR requests can be proxied through /api/ocr instead of calling the upstream OCR service directly.
Shenute AI API
Use POST /api/shenute with a UI-message payload. Supported providers are openrouter, gemini, and hf. When Hugging Face is rate-limited, the API can fall back to configured alternatives.
const response = await fetch("https://kyrilloswannes.com/api/shenute", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
inferenceProvider: "thoth",
messages: [
{
id: "u1",
role: "user",
parts: [{ type: "text", text: "Explain this Coptic phrase." }],
},
],
}),
});
const result = await response.text();OCR Proxy API
Use POST /api/ocr with multipart form data. Coptic Compass forwards the file to OCR_SERVICE_URL, then returns the upstream OCR response body and content-type to the client. You can pass ?lang=cop (or another language) and set OCR_UPLOAD_FIELD when your backend expects a specific upload field name.
# .env.local
OCR_SERVICE_URL=https://your-ocr-service/upload
# Optional when your backend expects a specific multipart field:
OCR_UPLOAD_FIELD=file
curl -X POST "https://kyrilloswannes.com/api/ocr?lang=cop" \
-F "file=@/path/to/coptic-image.jpg"
# Proxy flow
# 1) Client sends multipart/form-data to /api/ocr
# 2) Coptic Compass forwards to OCR_SERVICE_URL
# 3) Upstream OCR response is returned to the client