-
Notifications
You must be signed in to change notification settings - Fork 0
AI API Configuration
GitHub Copilot edited this page May 12, 2026
·
2 revisions
mdedit.io includes an AI assistant for editing and document work. You bring your own API key — no key is bundled with the app.
| Provider | Env Variable | Free Tier | Default Model |
|---|---|---|---|
| Groq (recommended) | GROQ_API_KEY |
Yes — console.groq.com | llama-3.3-70b-versatile |
| Google Gemini | GEMINI_API_KEY |
Yes — ai.google.dev | gemini-2.5-flash |
| OpenAI | OPENAI_API_KEY |
No | gpt-4.1 |
| Anthropic Claude | ANTHROPIC_API_KEY |
No | claude-3-7-sonnet-latest |
Groq is the recommended starting point — it has a free developer tier and fast inference.
Add the key to your .env file (based on .env.example):
# Groq (recommended)
GROQ_API_KEY=your_groq_api_key_here
# Optional: Google Gemini fallback
GEMINI_API_KEY=your_gemini_api_key_here
# Optional: override which provider and model to use by default
DEFAULT_AI_PROVIDER=groq
DEFAULT_AI_MODEL=llama-3.3-70b-versatileRestart the container after changing .env:
docker compose up -d --force-recreateIf no DEFAULT_AI_PROVIDER is set, the app picks the first provider that has a valid API key, in this order:
- Groq
- Gemini
- OpenAI
- Claude
Open the AI panel with Alt+Space (primary) or Ctrl+Space (fallback on Linux where Alt+Space conflicts with the window manager). Type your request in plain language — the assistant reads your current document and applies changes directly.
| Action | What happens |
|---|---|
ADVICE |
The AI explains or answers — no document change |
REPLACE |
Replaces the entire document with the AI's version |
APPEND |
Appends text at the end of the document |
PREPEND |
Prepends text at the start |
INSERT |
Inserts text at the cursor position |
For programmatic use or integration:
POST /api/chat/complete
{
"prompt": "The user request",
"document": "The current Markdown document (optional)",
"history": []
}{
"message": "Response / explanation to the user",
"markdown": "Updated Markdown — or null for ADVICE",
"action": "REPLACE | INSERT | APPEND | PREPEND | ADVICE"
}curl -X POST http://localhost:3210/api/chat/complete \
-H "Content-Type: application/json" \
-d '{"prompt": "Write an introduction about AI", "document": ""}'