-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
Technical reference for Aletheia's backend API.
Aletheia's backend exposes a REST API via AWS CloudFront. The API processes text analysis requests and returns etymology and context information.
https://[cloudfront-distribution].cloudfront.net
Currently, the API uses rate limiting rather than authentication tokens. This may change in future versions.
Analyze text for etymology and context.
POST /analyze
Content-Type: application/json{
"text": "string (required)",
"context": "string (optional)",
"session_id": "string (optional)"
}| Field | Type | Required | Description |
|---|---|---|---|
text |
string | Yes | The text to analyze (max 500 chars) |
context |
string | No | Surrounding context for disambiguation |
session_id |
string | No | Session identifier for continuity |
{
"signal": "green|yellow|orange|red",
"gem": "string",
"explanation": "string",
"etymology": {
"origin": "string",
"period": "string",
"evolution": "string"
}
}| Field | Type | Description |
|---|---|---|
signal |
string | Educational context level indicator |
gem |
string | Key historical insight (one-liner) |
explanation |
string | Full context explanation |
etymology |
object | Detailed etymology breakdown |
Request:
curl -X POST https://api.example.com/analyze \
-H "Content-Type: application/json" \
-d '{"text": "deadline"}'Response:
{
"signal": "yellow",
"gem": "Originally a literal line prisoners couldn't cross without being shot",
"explanation": "The word 'deadline' originated during the American Civil War...",
"etymology": {
"origin": "American English",
"period": "1860s",
"evolution": "Prison boundary line → publishing term → general time limit"
}
}{
"error": "bad_request",
"message": "Text field is required"
}{
"error": "payload_too_large",
"message": "Text exceeds maximum length of 500 characters"
}{
"error": "rate_limited",
"message": "Rate limit exceeded. Please try again later."
}{
"error": "internal_error",
"message": "An unexpected error occurred"
}| Limit | Value |
|---|---|
| Requests per minute | 30 |
| Requests per hour | 500 |
| Max text length | 500 characters |
The API implements content safety checks:
- Client-side: Extension filters before sending
- Server-side: Lambda validates input
- AI-level: Bedrock guardrails
Requests containing harmful content will be rejected with a 400 response.
The API supports CORS for browser extension requests:
Access-Control-Allow-Origin: chrome-extension://*
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-TypeThe API is currently unversioned (v1 implicit). Future breaking changes will use URL versioning:
/v2/analyze
No official SDKs are currently provided. The extension source code serves as a reference implementation.
See: extension-chrome-V3/service-worker.js
Aletheia — AI-Powered Context Analysis | MIT License | Report Security Issue
Wiki verified: 2026-02-19