Offline mode
    Developer Documentation

    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.

    x-api-key: YOUR_API_KEY

    API keys have read and write permissions. Write permission is required for adding cards.

    Base URL

    https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api

    Endpoints

    GET/decks

    List all decks for the authenticated user

    curl -X GET "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/decks" \
      -H "x-api-key: YOUR_API_KEY"
    GET/cards

    List 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"
    POST/add-deck

    Create 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"
      }'
    POST/add-card

    Add 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"
      }'
    GET/profile

    Get the authenticated user profile

    curl -X GET "https://rixmujwkfengqzbquxta.supabase.co/functions/v1/api/profile" \
      -H "x-api-key: YOUR_API_KEY"

    AI Endpoints

    POST/translate

    Translate 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"
      }'
    POST/detect-language

    Detect 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?"
      }'
    POST/generate-cards

    Extract 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"
      }'
    POST/chat

    Chat 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": "こんにちは!"}
        ]
      }'
    POST/explain

    Get 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"
      }'
    POST/mnemonic

    Generate 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)

    POST/track-content

    Track 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
      }'
    GET/content-views

    Get 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:

    1. Capture text displayed in the game (dialogue, items, quests)
    2. Get the user's decks via GET /decks
    3. POST to /add-card with deck_id, front_text, and back_text
    4. 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.