The logs confirm the key detail: AI_GATEWAY_API_KEY present: true, but the gateway request fails in ~200ms with a network-level "fetch failed" and an empty cause. That pattern almost always means the AI_GATEWAY_API_KEY environment variable is set to an invalid value. In v0/Vercel, the AI Gateway works automatically with zero config — but if a manually-set AI_GATEWAY_API_KEY is present and invalid (for example, if one of the Gemini keys got pasted into it), the SDK uses that bad key and the request fails.
Let me verify the current environment variable state.
I found the smoking gun. The logs show AI_GATEWAY_API_KEY present: true, but the request fails instantly with a network-level "fetch failed" and an empty cause. In the v0 preview environment, the AI Gateway authenticates automatically — you normally don't need an AI_GATEWAY_API_KEY at all. When one is present but holds an invalid value, the SDK tries to use that bad key and the request fails exactly like this.
This almost certainly happened during our earlier troubleshooting when several keys were being pasted in — one of the invalid keys (like the AQ.Ab8RN6... value) likely landed in AI_GATEWAY_API_KEY.
Here's how to fix it:
AI_GATEWAY_API_KEY and delete it (the preview provides gateway access automatically, so it doesn't need to be set)GEMINI_API_KEY and OPENAI_API_KEY since the app now routes through the gatewayAfter removing AI_GATEWAY_API_KEY, refresh the preview and try translating again.
If you actually do want to keep using an explicit gateway key, it must be a valid Vercel AI Gateway key (created at Vercel under AI Gateway → API Keys), not a Google or OpenAI key. But the simplest path is just to remove it and let the preview handle auth automatically.
I'll reroute the translation to use your GEMINI_API_KEY environment variable directly via Google's API. Let me update both routes.
I'll reroute both translation and analysis to call Google's Gemini API directly using your GEMINI_API_KEY environment variable instead of the Vercel AI Gateway.