AI Vocab Card Generator

AnkiWeb addon 776640448

Generates vocabulary card fields using AI/LLM APIs from a subtitle or sentence inside Anki's card editor.
AI-generated summary; may contain mistakes.

card-creationaishortcuts

Open on AnkiWeb GitHub Ask about alternatives

AnkiWeb

Rating
0 (πŸ‘ 0 Β· πŸ‘Ž 0)
Updated
2025-11-18
Anki versions
2.1.1~
Description language
en

Maintenance

stale

  • Last update or commit was 317 days before the snapshot (2025-11-18).

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.1+2025-11-18
History across monthly snapshots

Loading…

Similar addons

Vocab Miner

Generates formatted Anki cards from English words using Claude or ChatGPT, with example sentences, IPA, definitions, synonyms, vocabulary breakdowns, Google TTS audio, preview, and duplicate detection.

card-creationaiduplicatesdictionary

Rating 0 πŸ‘ 0 Β· πŸ‘Ž 0 ⭐ 0 Anki 2.1.4~ Updated 2026-03-28
LLM Card Fill

Queries Anthropic or OpenAI APIs with custom prompts to fill Anki note fields, supporting shortcuts, bulk updates, multiple note types, card creation, and debugging.

card-creationai

Rating 2 πŸ‘ 1 Β· πŸ‘Ž 1 ⭐ 1 Anki 26.09~ Updated 2026-09-24

README

AI Vocab Card Generator

An Anki add-on that automatically generates vocabulary card fields using AI/LLM APIs.

Overview

This add-on streamlines the process of creating vocabulary cards by integrating AI-powered field generation directly into Anki's card editor. Instead of manually filling out multiple fields for each card, you can generate them automatically from a single subtitle or sentence.

Installation

  1. Navigate to your Anki add-ons folder:

    • Open Anki
    • Go to Tools β†’ Add-ons β†’ View Files
  2. Create a new folder named ai_vocab_generator

  3. Save the add-on code as __init__.py in this folder

  4. Create a config.json file in the same folder with the following content:

{
  "api_endpoint": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp:generateContent",
  "api_key": "",
  "model": "gemini-2.0-flash-exp",
  "prompt_template": "Please create a vocabulary card for the following subtitle line.\nReturn ONLY a JSON object with these exact keys:\n\nSubtitle: {{subtitle}}\nContext Before: {{contextBefore}}\nContext After: {{contextAfter}}\nSource: {{source}}\n\nReturn JSON format:\n{\n  \"expression\": \"the main word or phrase to learn\",\n  \"reading\": \"pronunciation/reading (e.g., hiragana for Japanese)\",\n  \"meaning\": \"definition in English or target language\",\n  \"notes\": \"grammar notes, usage tips, etc.\"\n}",
  "field_mapping": {
    "expression": "Expression",
    "reading": "Reading",
    "meaning": "Meaning",
    "notes": "Notes"
  },
  "context_sentences": 1
}
  1. Restart Anki

Configuration

Getting an API Key

The add-on works with Google's Gemini API, which offers generous free tier limits.

  1. Visit Google AI Studio
  2. Click "Create API key"
  3. Copy the generated key

Setting up the Add-on

  1. In Anki, go to Tools β†’ AI Vocab Card Generator Config
  2. Paste your API key in the "API Key" field
  3. Customize the prompt template if needed
  4. Map AI response fields to your Anki note fields
  5. Save the configuration

Prompt Template

The prompt template supports the following placeholders:

  • {{subtitle}} - The main sentence or subtitle text
  • {{contextBefore}} - Previous sentences for context
  • {{contextAfter}} - Following sentences for context
  • {{source}} - Source material information

The default configuration includes an example prompt template optimized for Japanese vocabulary cards.

Field Mapping

Define how AI-generated fields map to your Anki note type:

AI JSON Key Anki Field Name
expression Expression
reading Reading
meaning Meaning
notes Notes

Add or remove mappings as needed for your card template.

Usage

Basic Workflow

  1. Create a new card in Anki (or use with asbplayer for subtitle mining)
  2. Fill in the sentence/subtitle field
  3. Click the "Generate with AI" button or press Ctrl+Shift+G
  4. The add-on will automatically populate the configured fields
  5. Review and save the card

Keyboard Shortcut

Ctrl+Shift+G - Generate card fields with AI

Supported APIs

The add-on automatically detects the API type based on the endpoint:

  • Google Gemini - Detects generativelanguage.googleapis.com in the endpoint
  • OpenAI - Default format for other endpoints

To switch APIs, simply change the endpoint URL and API key in the configuration.

OpenAI Configuration Example

{
  "api_endpoint": "https://api.openai.com/v1/chat/completions",
  "api_key": "sk-...",
  "model": "gpt-4"
}

Troubleshooting

"Please configure your API key" error

Make sure you've entered your API key in the configuration dialog.

"No subtitle text found" error

The add-on looks for text in fields named: Sentence, Subtitle, Text, or Expression. Ensure at least one of these fields contains text before generating.

Authentication errors

For Google Gemini, verify your API key is correct and has not expired. You can test it directly at Google AI Studio.

No fields updated

Check that your field mapping matches your note type's field names exactly. Field names are case-sensitive.

Advanced Usage

Custom AI Endpoints

The add-on can work with any LLM API that accepts JSON requests and returns text responses. You may need to modify the call_ai_api() function for APIs with different request/response formats.

Context Sentences

Adjust the "Context sentences to include" setting to provide more surrounding text to the AI. This can improve accuracy for ambiguous terms but will use more API tokens.

License

This add-on is provided as-is for personal use with Anki.