Question

Vercel function timeout on a 30-second AI call

Solved · 8 views · asked by kai_makes · edited

The OpenAI call takes 30 seconds. Vercel kills it at 10.

What I’ve tried

Set maxDuration = 60. Works on Pro, I'm on Hobby.

Comment

1 answer

Marked as helpful by the asker
jonas_k · edited

On Hobby the ceiling is fixed. Either stream the response (the function stays alive while bytes flow, and the user sees text early) or move the call to a queue and poll. Streaming is the one-hour change and the better UX anyway.

Comment