AI Vocab Card Generator

AnkiWeb addon 776640448

Generates vocabulary card fields from a subtitle or sentence using Gemini or OpenAI APIs, with customizable prompts, field mapping, context sentences, and a Ctrl+Shift+G shortcut.
AI-generated summary; may contain mistakes.

card-creationai

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
0 (👍 0 · 👎 0)
Updated
2025-11-18
Anki versions
2.1.1~
License
Not found (this does not mean that the addon has no license)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
Python, JSON
Description language
en

Maintenance

stale

  • Last update or commit: 2025-11-18 (348 days before the snapshot).
  • Commits in the last year: 1.
  • Issues: 0 open, 0 closed.
  • Pull requests: 0 open, 0 merged.

Will it work on my Anki?

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

Loading…

Similar addons

Anki AI Dynamic Cards Add-on (AI generated examples)

Generates fresh AI example sentences on the fly for simple English word or phrase cards, supports multiple AI providers, and stores nothing in your collection.

ai

5 votes 23% approval 👍 3 · 👎 2 ⭐ 4 Anki 2.1.66~ Updated 2025-12-24
IntelliFiller ChatGPT has 1 fork →

Autofills Anki card fields using ChatGPT or Claude via customizable prompts that reference field names, with saved prompts and batch filling across multiple selected cards.

card-creationai

29 votes 62% approval 👍 23 · 👎 6 Anki 24.11~ Updated 2025-03-09
AI Language Explainer

Generates contextual written explanations and spoken audio for target words in sentence cards using OpenAI models and selectable TTS engines, with one-click or batch processing.

card-creationaisync-integrationdictionary

10 votes 72% approval 👍 10 · 👎 0 ⭐ 9 Anki 2.1.66~ Updated 2025-10-07
LLM Card Fill

Queries Anthropic or OpenAI APIs with custom prompts to fill Anki note fields, supporting batch updates, card creation, and per-note-type configurations.

card-creationainote-management

2 votes 9% approval 👍 1 · 👎 1 ⭐ 1 Anki 26.09~ Updated 2026-09-24

Description

THIS ADDON IS ONLY FOR PEOPLE THAT KNOW EXACTLY WHAT THEY ARE DOING

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.

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.