API & MCP
Connect Android, scripts, and agents to the same account. Use Token auth from rest-auth for local and production testing.
Authentication
POST /rest-auth/login/— email + password →keytokenPOST /rest-auth/registration/— create accountPOST /rest-auth/password/reset/— forgot passwordPOST /api/token/— JWT obtain (username/password) for mobile clientsPOST /api/token/refresh//verify/— JWT refresh & verify- Header:
Authorization: Token <key>orAuthorization: JWT <token>
Core REST
GET /api/translate/?text=&fromLang=&toLang=— translate (auth)GET /api/translation-history/— history (auth)GET|POST /api/vocabulary/— list / create flashcardsDELETE /api/vocabulary/<id>/— soft-delete card
MCP
JSON-RPC tools for vocabulary live at
/mcp/
(RPC: /mcp/rpc/).
Local testing
BASE=http://127.0.0.1:8000
curl -s -X POST $BASE/rest-auth/login/ \
-H 'Content-Type: application/json' \
-d '{"email":"you@example.com","password":"***"}'
# use returned key:
curl -s $BASE/api/vocabulary/ -H "Authorization: Token $KEY"