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.

3 tutor routes11 languagesx-api-key auth2s rate limit

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

HTTP header
x-api-key: <Firebase tutor_api_key>

# Same value as server env X_API_KEY

Example (text)

curl
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 question

    Plain-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 question

    JPEG only, max 10MB. Math JSON or { answer, explanation }.

    Request
    Content-Type: multipart/form-data
    
    image: (JPEG file)
    languageCode: en
    Response
    {
      "success": true,
      "data": {
        "answer": "...",
        "verification": "...",
        "steps": [ ... ],
        "why": { ... }
      }
    }
  • POST/api/v1/tutor/filePDF document

    PDF max 15MB. Text extraction only — scanned PDFs return 400.

    Request
    Content-Type: multipart/form-data
    
    file: application/pdf
    languageCode: en
    Response
    {
      "success": true,
      "data": {
        "answer": "Summary + key points + answers (one string)"
      }
    }
  • GET/api/healthHealth

    No 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.

enarzhdefrptesittridms

Firebase Remote Config

  • 1tutor_api_base_urlhttps://studysmarter.habittrackerapi.com
  • 2tutor_api_keyMatches server X_API_KEY

HTTP status codes

CodeMeaning
200Success
400Bad request
401Unauthorized
429Rate limited
502Upstream / format