Language Games REST API
Build game plugins and integrations that create flashcards automatically as players encounter new vocabulary. Building for an AI assistant instead? Use the Language Games MCP server.
Authentication
Generate an API key from your Settings page. Include it in the x-api-key header of all requests.
API keys have read and write permissions. Write permission is required for adding cards.
Base URL
Endpoints
/decksList all decks for the authenticated user
curl -X GET "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/decks" \ -H "x-api-key: YOUR_API_KEY"
/cardsList cards in a specific deck
curl -X GET "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/cards?deck_id=DECK_ID" \ -H "x-api-key: YOUR_API_KEY"
/add-deckCreate a new deck (requires write permission)
curl -X POST "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/add-deck" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Spanish Vocabulary",
"target_language": "es",
"description": "Common Spanish words",
"native_language": "en"
}'/add-cardAdd a new card to a deck (requires write permission)
curl -X POST "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/add-card" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"deck_id": "DECK_ID",
"front_text": "Hola",
"back_text": "Hello",
"language": "es"
}'/profileGet the authenticated user profile
curl -X GET "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/profile" \ -H "x-api-key: YOUR_API_KEY"
AI Endpoints
/translateTranslate text between languages
curl -X POST "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/translate" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, how are you?",
"target_language": "es",
"source_language": "en"
}'/detect-languageDetect the language of a text
curl -X POST "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/detect-language" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Bonjour, comment allez-vous?"
}'/generate-cardsExtract vocabulary flashcards from text using AI
curl -X POST "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/generate-cards" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "El gato negro duerme en la casa.",
"target_language": "es",
"native_language": "en"
}'/chatChat with an AI language tutor
curl -X POST "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/chat" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"target_language": "Japanese",
"messages": [
{"role": "user", "content": "こんにちは!"}
]
}'/explainGet a concise explanation of a word/phrase with usage examples
curl -X POST "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/explain" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "食べる",
"translation": "to eat",
"target_language": "ja",
"native_language": "en"
}'/mnemonicGenerate a memorable mnemonic to help remember vocabulary
curl -X POST "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/mnemonic" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "고양이",
"translation": "cat",
"target_language": "ko",
"native_language": "en"
}'Content Tracking (Browser Extensions)
/track-contentTrack third-party video/content views (for browser extensions). Requires write permission.
curl -X POST "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/track-content" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source_url": "https://youtube.com/watch?v=xyz",
"source_type": "video",
"platform": "youtube",
"title": "Learn Japanese in 10 Minutes",
"language": "ja",
"duration_seconds": 600,
"watched_seconds": 300
}'/content-viewsGet the user's content viewing history
curl -X GET "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/content-views?limit=20&language=ja" \ -H "x-api-key: YOUR_API_KEY"
Building a Game Plugin
The typical workflow for a game plugin:
- Capture text displayed in the game (dialogue, items, quests)
- Get the user's decks via
GET /decks - POST to
/add-cardwith deck_id, front_text, and back_text - Cards are added to the user's deck for spaced repetition review
Pro tip: Use POST /generate-cards to automatically extract vocabulary from game text, then add cards in bulk!
See our existing plugins for reference implementations.