All api calls return 502 - nextjs 14 - react 18

Yeah your function seems to be timing out:

Have you tried to refer to: [Support Guide] Why is my function taking long or timing out?

Also you’re using Next.js 14. Next.js Runtime v4 doesn’t support that. Try upgrading to Runtime v5 from the UI.