REST · OpenAPI 3
Study Smarter API
Mobile app yahan tutor requests bhejti hai. Firebase ads + Remote Config handle karta hai. Groq sirf server par — client mein kabhi gsk_ mat daalo.
Production
studysmarter.habittrackerapi.com
Chat model
openai/gpt-oss-120b
Vision model
qwen/qwen3.6-27b
Quick start
Header x-api-key required on every /api/v1/* route. Send languageCode in JSON body or multipart form — not as a language header.
Authentication
x-api-key: <Firebase tutor_api_key> # Same value as server env X_API_KEY
Example (text)
curl -X POST "https://studysmarter.habittrackerapi.com/api/v1/tutor/ask" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_CLIENT_KEY" \
-d '{"prompt":"What is 2+2?","languageCode":"en"}'Endpoints
Maps to app requirements: askOpenAI → ask, analyzeImage → image, analyzeFile → file.
- POST
/api/v1/tutor/askText questionPlain-text tutor answer with step-by-step math, summary label, and app language.
Request{ "prompt": "Explain photosynthesis briefly", "languageCode": "en" }Response{ "success": true, "message": "Answer generated.", "statusCode": 200, "data": { "text": "..." } } - POST
/api/v1/tutor/imageImage questionJPEG only, max 10MB. Math JSON or { answer, explanation }.
RequestContent-Type: multipart/form-data image: (JPEG file) languageCode: en
Response{ "success": true, "data": { "answer": "...", "verification": "...", "steps": [ ... ], "why": { ... } } } - POST
/api/v1/tutor/filePDF documentPDF max 15MB. Text extraction only — scanned PDFs return 400.
RequestContent-Type: multipart/form-data file: application/pdf languageCode: en
Response{ "success": true, "data": { "answer": "Summary + key points + answers (one string)" } } - GET
/api/healthHealthNo x-api-key. Uptime checks.
Request(no body)
Response{ "success": true, "data": { "service": "study-smarter-api", "status": "ok" } }
App languages
Invalid or missing code → en.
Firebase Remote Config
- 1
tutor_api_base_urlhttps://studysmarter.habittrackerapi.com - 2
tutor_api_keyMatches server X_API_KEY
HTTP status codes
| Code | Meaning | When |
|---|---|---|
| 200 | Success | Response includes data envelope. |
| 400 | Bad request | Validation, wrong file type, or unreadable PDF. |
| 401 | Unauthorized | Missing or invalid x-api-key. |
| 429 | Rate limited | Minimum 2 seconds between requests per key. |
| 502 | Upstream / format | Groq error or AI output failed validation. |