Coptic Compass Public API Docs
Explore the public grammar and dictionary APIs in Swagger, then integrate Shenute AI and OCR-backed image context.
Public consumers should usually start with /api/openapi.json for discovery. Grammar lives at /api/v1/grammar, dictionary search at /api/v1/dictionary/search, Shenute AI at /api/shenute, and OCR requests through /api/ocr.
Dictionary API
Use GET /api/v1/dictionary/search with filters for q, dialect, partOfSpeech, etymology, hasGreek, hasInflections, hasRelatedEntries, exact, limit, and offset. Use the reduced full index at /api/v1/dictionary/search-index.
const response = await fetch(
"https://www.copticcompass.com/api/v1/dictionary/search?q=ⲙⲟⲓ&dialect=B&partOfSpeech=V&limit=10",
);
const page = await response.json();
const headwords = page.entries.map((entry) => entry.headword);Shenute AI API
Use POST /api/shenute with a UI-message payload. Supported providers are thoth, openrouter, gemini, and hf. When Hugging Face is rate-limited, the API can fall back to configured alternatives.
const response = await fetch("https://www.copticcompass.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://www.copticcompass.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