A minimal Next.js chat app (App Router, AI SDK streamText + useChat) whose model can call a live web search tool backed by AgentSearch. Search uses the free AgentSearch relay: 25 searches/day per user, no AgentSearch key.
npm install
cp .env.example .env.local # add OPENAI_API_KEY
npm run dev # http://localhost:3000The tool lives in lib/agentsearch.ts; the route is app/api/chat/route.ts. Swap in any AI SDK provider in the route.
Import the repo in Vercel and set OPENAI_API_KEY. Nothing else is needed.
For unlimited search plus page extract and JS rendering ($0.005 per call in USDC on Base via x402), see the AgentSearch docs and the MCP server @agentsearchhq/agentsearch-mcp.
MIT