English Vocab Card Generator for Anki (OpenAI / Gemini / Qwen)

AnkiWeb addon 997363698

Generates complete English vocabulary flashcards from a headword using OpenAI-compatible or Gemini providers, filling definitions, examples, IPA, translations, cloze, audio, and optional mnemonic images into a chosen deck.
AI-generated summary; may contain mistakes.

card-creationai

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
0 (👍 0 · 👎 0)
Updated
2025-12-20
Anki versions
25.09.2~
License
MIT (from the license file in the package)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
Python, JSON, Ignore List
Description language
en

Maintenance

stale

  • Last update or commit: 2025-12-20 (316 days before the snapshot).
  • Commits in the last year: 28.
  • Issues: 0 open, 0 closed.
  • Pull requests: 0 open, 0 merged.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.5525.09.2+2025-12-20
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

Description

An Anki add-on for English learners. Enter a headword and it automatically generates definition, example sentence, phonetic (IPA), paraphrase/synonyms, Chinese translation, word cloze, optional mnemonic image, and TTS audio, then writes everything into your target deck and note type. Supports multiple providers: OpenAI‑compatible (OpenAI, DeepSeek, Qwen, Kimi, Grok) and Gemini.

Features

  • One-click vocab card: meaning, example, IPA, paraphrase/synonyms, Chinese translation, cloze
  • Auto-generate and insert audio for word and example (mp3/wav depending on provider)
  • Optional mnemonic image field; media cached to avoid duplicate calls
  • Multi-provider: OpenAI‑compatible (OpenAI/DeepSeek/Qwen/Kimi/Grok) and Gemini
  • Per-provider proxy, models, and voice pools; random voice selection supported
  • Customizable deck, note type, and field mapping; Anki 2.1.55+

README

English Vocab Card Generator for Anki (OpenAI / Gemini / Qwen)

English | 简体中文

An Anki add-on for English learners. Enter a headword and it automatically generates definition, example sentence, phonetic (IPA), paraphrase/synonyms, Chinese translation, word cloze, optional mnemonic image, and TTS audio, then writes everything into your target deck and note type. Supports multiple providers: OpenAI‑compatible (OpenAI, DeepSeek, Qwen, Kimi, Grok) and Gemini.

Features

  • One-click vocab card: meaning, example, IPA, paraphrase/synonyms, Chinese translation, cloze
  • Auto-generate and insert audio for word and example (mp3/wav depending on provider)
  • Optional mnemonic image field; media cached to avoid duplicate calls
  • Multi-provider: OpenAI‑compatible (OpenAI/DeepSeek/Qwen/Kimi/Grok) and Gemini
  • Per-provider proxy, models, and voice pools; random voice selection supported
  • Customizable deck, note type, and field mapping; Anki 2.1.55+

Installation

  • Copy this folder into your Anki user directory at addons21/AnkiVocabCardGenerator.
  • Or use “Tools → Add-ons → Install from folder” to import this directory.
  • Restart Anki.

Configuration

Edit config.json in the project root. Choose providers and tune models/voices. API keys are read from environment variables or a local .env file (no real keys in VCS).

Example:

{
  "proxy": "http://127.0.0.1:8118",
  "proxy_enabled_map": {
    "openai": true,
    "deepseek": false,
    "qwen": false,
    "kimi": false,
    "grok": false,
    "gemini": true
  },

  "text_provider": "gemini",
  "tts_provider": "gemini",
  "image_provider": "gemini",

  "api_bases": {
    "openai": "https://api.openai.com/v1",
    "deepseek": "https://api.deepseek.com/v1",
    "qwen": "https://dashscope.aliyuncs.com/compatible-mode/v1",
    "kimi": "https://api.moonshot.cn/v1",
    "grok": "https://api.x.ai/v1",
    "gemini": "https://generativelanguage.googleapis.com/v1beta/openai"
  },
  "api_bases_audio": {
    "qwen": "https://dashscope.aliyuncs.com/api/v1"
  },

  "text_models": {
    "openai": "gpt-4o-mini",
    "deepseek": "deepseek-chat",
    "qwen": "qwen-flash",
    "kimi": "moonshot-v1-8k",
    "grok": "grok-2-mini",
    "gemini": "gemini-2.5-pro"
  },
  "text_params": {
    "openai": {"temperature": 0.4, "response_format": "json_object"},
    "deepseek": {"temperature": 0.4, "response_format": "json_object"},
    "qwen": {"temperature": 0.4, "response_format": "json_object"},
    "kimi": {"temperature": 0.4, "response_format": "json_object"},
    "grok": {"temperature": 0.4, "response_format": "json_object"},
    "gemini": {"temperature": 0.4}
  },

  "enable_tts_word": true,
  "enable_tts_example": true,
  "enable_image": true,
  "field_image": "Image",

  "deck_name": "Vocab",
  "note_type": "VocabularyPro",

  "field_word": "Word",
  "field_meaning": "Meaning",
  "field_example": "Example",
  "field_phonetic": "Phonetic",
  "field_audio": "Audio",
  "field_audio_example": "AudioExample",
  "field_synonyms": "Synonyms",
  "field_notes_cn": "NotesCN",
  "field_word_cloze": "WordCloze"
}
  • If using a proxy, ensure address and protocol are correct. You can enable/disable per provider via proxy_enabled_map.
  • text_provider, tts_provider, and image_provider select which backend to use. Models can be overridden per provider via text_models, tts_models, image_models or via adapter configs in tts/*_config.json and image/*_config.json.
  • The system prompt is in system_prompt.txt so you can edit it without changing code.
  • Audio format is provider-specific (mp3 or wav) and the correct extension is auto-selected.

Prepare the Note Type

Create a note type named VocabularyPro with these fields:

  • Word
  • Meaning
  • Example
  • Phonetic
  • Audio
  • AudioExample
  • Synonyms
  • NotesCN
  • WordCloze
  • Image (optional)

Ensure field names match config.json. The deck defaults to Vocab and is created automatically if missing. Audio fields are filled with Anki [sound:filename] tags.

Usage

  • Open Anki and go to “Tools → OpenAI: Create Vocab Card”.
  • Enter an English word and optionally enable “Generate Mnemonic Image”.
  • Content is generated in the background and the card is created; a tooltip confirms success and the card is added to the Vocab deck.

How It Works

  • Text generation: provider-specific endpoints unify to an OpenAI‑compatible payload; strict JSON is enforced by system_prompt.txt (__init__.py orchestrates calls).
  • Audio generation: pluggable adapters under tts/ select provider and voice; audio is cached in media with correct extension.
  • Image generation: pluggable adapters under image/ can create a small mnemonic image and cache it.
  • Note writing: fields are populated, audio/image saved to media, and the target deck is used.
  • Menu entry: on profile open, a Tools menu action is registered for quick access.

Privacy & Costs

  • Do not commit real API keys.
  • Key resolution order: environment → .env → config.json.
  • Supported environment variable names:
    • OPENAI_API_KEY, DEEPSEEK_API_KEY, DASHSCOPE_API_KEY (Qwen), DOUBAO_API_KEY, MOONSHOT_API_KEY (Kimi), XAI_API_KEY (Grok), GEMINI_API_KEY.
  • You may create a local .env file in the add-on directory (ignored by .gitignore) containing lines like GEMINI_API_KEY=xxxxx.
  • API usage may incur costs; ensure your account has quota.

License

MIT License. See LICENSE.

Project Structure

AnkiVocabCardGenerator/
├── __init__.py              # Add-on entrypoint: menu, background tasks, orchestration
├── manifest.json            # Anki add-on metadata
├── config.json              # Providers, models, proxy, fields, deck/note config
├── system_prompt.txt        # System prompt for strict JSON output
├── image/
│   ├── __init__.py          # Image adapter registry
│   ├── openai.py            # OpenAI‑compatible image generation
│   ├── gemini.py            # Gemini image generation
│   ├── qwen.py              # Qwen (DashScope) image generation
│   ├── openai_config.json   # Default model/size for OpenAI images
│   └── qwen_config.json     # Default model/size for Qwen images
├── tts/
│   ├── __init__.py          # TTS adapter registry and format chooser
│   ├── openai.py            # OpenAI‑compatible TTS
│   ├── gemini.py            # Gemini TTS (wav)
│   ├── qwen.py              # Qwen TTS via DashScope
│   ├── openai_config.json   # Default model/voice/format
│   ├── gemini_config.json   # Default model/voice/format
│   └── qwen_config.json     # Default model/voice/format
├── README.md                # English documentation
├── README.zh-CN.md          # Simplified Chinese documentation
├── LICENSE                  # MIT license
└── debug.log                # Runtime log created at add-on root