Skip to content

AI Assistant

The admin includes optional AI features for content generation. Powered by the Vercel AI SDK — works with OpenAI and other providers.

Add to your .env:

Terminal window
AI_PROVIDER=openai
AI_API_KEY=sk-...
AI_MODEL=gpt-4o-mini

AI buttons appear automatically in the admin when these env vars are set.

On the asset detail page, an “Generate alt text” button sends the image to the AI model and streams back a description. Works with uploaded images only (reads from disk).

On post/page edit forms, a “Generate” button next to the SEO description field creates a meta description from the document’s title, excerpt, and body.

In the translation view, each translatable text and rich text field gets a “Translate from EN” button that:

  • Text fields — translates plain text
  • Rich text fields — translates while preserving the JSON AST structure

All AI responses are streamed — you see the text appear as it generates.

Env varDefaultDescription
AI_PROVIDERProvider name (openai)
AI_API_KEYAPI key for the provider
AI_MODELModel to use (e.g. gpt-4o-mini)

Without AI_PROVIDER and AI_API_KEY, all AI buttons are hidden. No AI dependencies are loaded.