In AI mode, the user passes a plain text prompt describing the document they want. The plugin calls OpenRouter, which routes the request to any of 100+ AI models including Claude, GPT-4, and Gemini. The AI returns a complete, professionally styled HTML document. The plugin then renders it invisibly in an iframe, captures it with html2canvas, converts it to PDF using jsPDF, and triggers an automatic download. The entire process happens client-side with no external service required beyond the OpenRouter API call.