AgentMail is the fastest way to give a Vercel AI agent its own email inbox. Every user or agent gets a dedicated inbox, created programmatically from any Next.js route.
The AgentMail TypeScript SDK works seamlessly in Next.js API routes and serverless functions. Add email to any Vercel-hosted AI application in minutes.
npm install agentmail# vercel env add AGENTMAIL_API_KEY
# Or in the Vercel dashboard: Settings -> Environment Variablesimport AgentMail from "agentmail";
const client = new AgentMail({
apiKey: process.env.AGENTMAIL_API_KEY!,
});Create one inbox per user, per agent session, or per customer. AgentMail handles the namespace - you just pass a username. No DNS config, no email provider setup.
The AgentMail SDK makes standard HTTPS requests. It works in Vercel serverless functions, Edge functions, and App Router route handlers without modification.
Create 1,000 inboxes in a loop or create them on-demand when users sign up. There's no manual setup, no form to fill out - just an API call.
// app/api/agent/inbox/route.ts
import AgentMail from "agentmail";
import { NextResponse } from "next/server";
const client = new AgentMail({ apiKey: process.env.AGENTMAIL_API_KEY! });
export async function POST(request: Request) {
const { userId } = await request.json();
const inbox = await client.inboxes.create();
return NextResponse.json({ inboxId: inbox.inboxId, email: inbox.inboxId });
}Common questions about AgentMail and Vercel.
Free tier. No credit card required. Inboxes ready in under a second.
Start for free© 2026 AgentMail, Inc. All rights reserved.