Implementation Notes
This setup keeps your AI pipeline inside your own API route. Choose it when you need model and infrastructure control; better-cmdk's default hosted chat is only a free trial path (no signup, 10 requests per 10 minutes).
Best For
- - Teams already shipping Vercel AI SDK routes
- - Apps that need provider flexibility without changing UI components
- - Products that want chat in the command menu before adding AI actions
Quick Setup Checklist
- 1. Install better-cmdk with ai and @ai-sdk/react dependencies.
- 2. If you need custom model control, create app/api/chat/route.ts with streaming response support.
- 3. Pass chatEndpoint to CommandMenu and test responses in both themes.
- 4. Add request logging and rate limits before production rollout.