API Reference
A single, stable API that powers MoogleTechnology apps — chat, translation, math, search, OCR, speech, and document extraction.
Base URL & Authentication
All requests use the same base URL and a Bearer token in the Authorization header.
https://ai.moogletechnology.com
Authorization: Bearer YOUR_TOKEN
curl https://ai.moogletechnology.com/health \
-H "Authorization: Bearer $MOOGLE_TOKEN"
Chat Completions
Generate responses from your configured provider (local, cloud, or hybrid). This is the primary endpoint used across Moogle apps. :contentReference[oaicite:0]{index=0}
Request Body
| Parameter | Type | Notes |
|---|---|---|
| model | string | Recommended (example: "moogle-1") |
| messages | array | Chat history objects: { role, content } |
| temperature | number | Optional (default varies by server config) |
curl https://ai.moogletechnology.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MOOGLE_TOKEN" \
-d '{
"model": "moogle-1",
"messages": [
{"role": "user", "content": "Write a 1-sentence product tagline for a PDF editor."}
]
}'
Translate
Translate text into a target language using the gateway’s configured translate mode. :contentReference[oaicite:1]{index=1}
curl https://ai.moogletechnology.com/v1/translate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MOOGLE_TOKEN" \
-d '{
"text": "Good morning. How are you?",
"to": "fr"
}'
Math Solve
Solve math or structured logic tasks via the gateway’s math mode. :contentReference[oaicite:2]{index=2}
curl https://ai.moogletechnology.com/v1/math/solve \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MOOGLE_TOKEN" \
-d '{
"question": "Simplify: (3/4) + (2/3). Show steps."
}'
Search
Retrieve grounded results (URLs + snippets) for a query. Accepts q (or query) and optional result count. :contentReference[oaicite:3]{index=3}
curl https://ai.moogletechnology.com/v1/search \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MOOGLE_TOKEN" \
-d '{
"q": "best offline pdf editor features",
"num": 5
}'
Vision OCR
OCR for images using the configured local vision model pathway. :contentReference[oaicite:4]{index=4}
curl https://ai.moogletechnology.com/v1/vision/ocr \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MOOGLE_TOKEN" \
-d '{
"image_base64": ""
}'
Audio Transcriptions
Upload an audio file as multipart form-data field file. Returns { "text": "..." }. :contentReference[oaicite:5]{index=5}
curl https://ai.moogletechnology.com/v1/audio/transcriptions \
-H "Authorization: Bearer $MOOGLE_TOKEN" \
-F "file=@sample.wav"
Text-to-Speech
Generate speech audio from text. This gateway supports format=wav and accepts input (or text). :contentReference[oaicite:6]{index=6}
curl https://ai.moogletechnology.com/v1/audio/speech \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MOOGLE_TOKEN" \
-d '{
"input": "Welcome to MoogleTechnology.",
"format": "wav"
}' --output speech.wav
PDF Text Extraction
Upload a PDF as multipart form-data field file. Returns { "text": "..." }. :contentReference[oaicite:7]{index=7}
curl https://ai.moogletechnology.com/v1/pdf/extract \
-H "Authorization: Bearer $MOOGLE_TOKEN" \
-F "file=@document.pdf"
Models
List available models exposed through the gateway (varies by deployment). :contentReference[oaicite:8]{index=8}
curl https://ai.moogletechnology.com/v1/models \
-H "Authorization: Bearer $MOOGLE_TOKEN"
Health
Basic service health endpoint. :contentReference[oaicite:9]{index=9}
curl https://ai.moogletechnology.com/health \
-H "Authorization: Bearer $MOOGLE_TOKEN"
Word Relations
Lightweight word suggestions. Query params: term (required) and limit (optional). :contentReference[oaicite:10]{index=10}
curl "https://ai.moogletechnology.com/v1/words/related?term=focus&limit=12" \
-H "Authorization: Bearer $MOOGLE_TOKEN"
Error Handling
The gateway uses standard HTTP status codes and returns errors as JSON: { error: { message } }.
Unauthorized
Missing or invalid Bearer token.
Rate Limited
Too many requests. Slow down and retry.
Server / Upstream Error
Gateway error or provider unavailable.