I just upgraded to v6 and used the generateText with the new syntax like this:
Code
const systemPrompt = `
<context_gathering>
Du bist ein professioneller Übersetzer für Krypto-News.
Du bekommst eine Liste von News-Artikeln und musst ALLE übersetzen.
Die Anzahl der zurückgegebenen Artikel muss numerisch exakt der Eingabe entsprechen
(keine zusätzlichen Zeilenumbrüche, keine Auslassungen).
Die Zielsprache ist Deutsch.
</context_gathering>
`
const res = await generateText({
model: 'openai/gpt-oss-20b',
system: systemPrompt,
prompt: `
Übersetze alle Objekt-felder, außer die 'id'.
Input data: ${JSON.stringify(input, null, 2)}
`,
output: Output.object({
schema: z.object({
news: z.array(
z.object({
ai_wrapup_text_de: z.string(),
description_de: z.string(),
id: z.string(),
title_de: z.string(),
})
),
}),
}),
})
Still the same issue. I tried to only use groq with the providerOptions, same issue still.
I tried to change model to e.g. gpt-5-nano, the response then took almost 2 minutes but it responded successful.
Update: Got it down to 20-30 seconds with
providerOptions: {
openai: {
reasoningEffort: 'low',
},
},
Then I tried to use google/gemini-2.5-flash-lite. First test 8sec and successful. Second one 30 seconds and also successful.
So to me this seems that the AI Gateway (or the providers) have some issues with latency, and especially some issues with gpt-* models.