FUNCTION_INVOCATION_TIMEOUT
what this Vercel error means
How it shows up
504 FUNCTION_INVOCATION_TIMEOUT
What it means
A Vercel Function took longer than its allowed execution time, so Vercel stopped waiting and returned 504 Gateway Timeout.
The usual cause in an AI-built app
AI-generated API routes often wait for a slow step, such as a full AI model response or a large database query, before replying, and that wait runs past the function's maximum duration on your plan.
Check this first
Open the request in your Vercel project's Logs and compare how long the function ran with the maximum duration that applies to it.