Supabase Edge Function timing out on AI calls? The 150-second limit

Ship ItChecked against the official source

The short answer

Supabase Edge Functions have a time limit: 150 seconds on the Free plan and 400 on paid plans. If a function sends nothing back for 150 seconds, the request ends with a 504 error. Long AI answers can hit that, so the feature works on short prompts and fails on long ones.

What to do

  1. Answer right away with a job ID, and do the slow AI work in the background.
  2. Show the result when it's ready.
  3. Or stream the answer, so the user sees it as it arrives.

Source

Checked on 30 Sept 2026. Prices, limits and settings change, so check the source before you rely on them.