Formats

Pattern
Agent XLSX Artifact
Download-first Excel artifact pattern. The agent streams CSV through a tool call, renders a spreadsheet preview, and exports a real .xlsx file with SheetJS.
IntermediateJun 2026View the full pattern on desktop


Problems solved
- Stream workbook CSV from an agent tool call
- Preview tabular output before download
- Export a real .xlsx file client-side with SheetJS
Use cases
- Excel report generation
- Budget and forecast spreadsheet exports
- Pipeline trackers and data exports
- Download-first spreadsheet agents
AI SDK APIs
streamTextcreateUIMessageStreamgatewaytooluseChat
Tags
aiexcelxlsxspreadsheetoffice-docsstreamingai-sdkartifacts
Requirements
- Node.js
- 24+
- Memory
- 256MB
- Other
- Vercel AI Gateway API key
Environment variables
AI_GATEWAY_API_KEYGet key
External services
openaiupstash
Ready to use?
View the full interactive pattern with live preview and copy the source code.
View the pattern on desktop






