This guide focuses only on generating images with OpenAI for your
PlanetFam quiz app. We'll build a Node.js CLI that: - Takes a
country (+ dishes/landmarks) as input\
- Calls OpenAI's image API (defaults to
dall-e-3
)\ - Outputs a 9:16 vertical WebP (~100 KB)\
- Updates a small
manifest.json
for your app to read
Why
dall-e-3
? It's high‑quality and doesn't require org
verification. You can switch togpt-image-1
later (requires
verification) by passing a flag/env var.
1) Project setup
mkdir planetfam-scripts && cd planetfam-scripts
npm init -y
npm install openai sharp fs-extra yargs
Set your API key (macOS/Linux):
export OPENAI_API_KEY=sk-...yourkey...
Windows (Powershell):
$env:OPENAI_API_KEY="sk-...yourkey..."
Top comments (0)