Better fix than chasing a longer timeout: stream it. As long as bytes keep flowing, the user sees the report building up, and it doesn't feel like a 90 second wait.
export const maxDuration = 60; // or whatever your plan allows
export async function POST(req: Request) {
const completion = await openai.chat.completions.create({ model, messages, stream: true });
// pipe completion into a ReadableStream and return it
}If the job is truly long (several minutes, multiple calls), move it out of the request entirely: save a "pending" row, run the work in a background job (Inngest, Trigger.dev, a queue), and poll or subscribe for the result.