
Build an AI Agent With 40 Real Tools in Under 50 Lines of Code
Most "AI agent" tutorials stop at calling a single API. But real agents need real tools — DNS lookups, screenshots, crypto prices, code execution, file storage, and more. In this tutorial, I'll show you how to build a JavaScript AI agent that has access to 40 production tools through a single API key. The whole thing is under 50 lines. What We're Building An AI agent that can: Take screenshots of any website Look up DNS records and IP geolocation Check live crypto prices Execute code in a sandbox Generate QR codes Scrape web pages ...and 34 more tools All through one REST API endpoint. Prerequisites Node.js 18+ An OpenAI API key (or Anthropic — I'll show both) A free API key from Agent Gateway (200 free credits, no credit card) Step 1: Get Your API Key curl https://agent-gateway-kappa.vercel.app/api/keys/create Response: { "apiKey" : "ag_xxxxxxxxxxxx" , "credits" : 200 , "rateLimit" : "100 requests/hour" } Save that API key. Each tool call costs 1 credit. Step 2: Define Your Tools The
Continue reading on Dev.to Tutorial
Opens in a new tab




