SID
09/04/2025, 6:07 PMVapi Support Bot
09/04/2025, 6:08 PMjs
export default function handler(req, res) {
res.setHeader('Access-Control-Allow-Origin', '*');
// ...your existing logic
res.status(200).json({ message: 'Thank You' });
}
This allows cross-origin requests and should fix CORS-related network errors when called from the API Request Tool.
Source:
- [Server URLs Vapi Documentation](https://docs.vapi.ai/server-url)Chiranjeet Mishra
09/08/2025, 1:52 PM# Test your endpoint directly
vapi listen --forward-to your-endpoint
For your specific CORS issue with a Next.js app on Vercel, you would need to consult Next.js and Vercel documentation as this appears to be a general web infrastructure issue rather than a Vapi-specific problem.