Generate images from text prompts in a Next.js route with OpenAI GPT Image
A Next.js App Router endpoint that turns a prompt into a PNG with gpt-image-2.5-flare, plus a small page to try it in the browser.
Install
npx shadcn add https://www.wirestack.site/r/openai-image-generation-nextjs-route.json.env.local.Your keys
0 of 1 ready
Create each key on its own page, paste it below, then copy the finished lines into your project's .env file. Your keys stay in this tab. They are never sent to Wirestack or saved; we only count that the panel was used.
- OpenAI API keyOPENAI_API_KEYGet key
Click Create new secret key
Free accounts can open one adapted integration a month. Sign in to try it.
Set it up by hand
No AI tool or account needed: follow the steps and copy the code into your project.



