Skip to main content
The Vercel adapter enables deploying agents as serverless functions on Vercel’s edge platform.

Import


handle_vercel

The handle_vercel function bridges Vercel’s HTTP handler to the agent system.

Function Signature

Parameters

Agent
required
The agent instance to handle requests.
BaseHTTPRequestHandler
required
Vercel’s HTTP handler instance.

Usage Examples

Basic Vercel API Route

Multiple Endpoints

With Environment Variables


Project Structure


Error Handling

The Vercel adapter returns a plain text error response:
For custom error handling, wrap the agent in your handler class.