API reference
AI placeholder images from a URL. Drop a link into an <img> tag and get a contextually appropriate, web-ready image — generated once, cached forever on a CDN.
https://your-instance.vercel.appQuick start
Paste this into any HTML page and an image appears — no API key, no JavaScript:
<img src="https://your-instance.vercel.app/i/1200x600?prompt=modern+fintech+dashboard+hero&style=photographic" />
That's the entire integration. The first load generates the image; every load after is an instant CDN cache hit.
The URL pattern
https://your-instance.vercel.app/i/{width}x{height}?prompt={description}&style={style}{width}x{height}— exact pixel dimensions, e.g.1200x600prompt— what the image should show (URL-encode spaces as+)style— optional visual preset (see below)
Parameters
Dimensions are clamped to 64–2048 per side, ~4 megapixels max.
Styles
A server-side prompt layer turns terse prompts into clean web imagery. Select with style=:
Examples
<!-- Hero banner -->
<img src="https://your-instance.vercel.app/i/1600x700?prompt=modern+SaaS+product+hero+dashboard&style=photographic" />
<!-- Team / about photo -->
<img src="https://your-instance.vercel.app/i/800x600?prompt=diverse+team+collaborating+in+bright+office&style=photographic" />
<!-- CSS background -->
.hero {
background-image: url("https://your-instance.vercel.app/i/1920x1080?prompt=abstract+blue+gradient+tech+background&style=abstract");
background-size: cover;
}
<!-- Different image, same prompt -->
https://your-instance.vercel.app/i/600x400?prompt=coffee+shop+interior&seed=2JSON API
When you want the URL handed back instead of generating on load:
curl -X POST https://your-instance.vercel.app/api/generate \
-H "Content-Type: application/json" \
-d '{
"prompt": "modern fintech dashboard hero",
"width": 1200,
"height": 600,
"style": "photographic"
}'Response:
{
"url": "https://...blob.vercel-storage.com/cache/abc123.webp",
"cached": false,
"width": 1200,
"height": 600,
"model": "gemini-2.5-flash-image",
"id": "abc123..."
}Health
Liveness check and the active model:
curl https://your-instance.vercel.app/api/health
# → { "ok": true, "model": "gemini-2.5-flash-image" }Using with Claude Code
Drop this into your project's CLAUDE.md and Claude Code uses Banana Stand automatically whenever it adds images:
# Placeholder Images
For placeholder images on this site, use the Banana Stand API.
Write image URLs as:
https://your-instance.vercel.app/i/{width}x{height}?prompt={url-encoded+description}&style=photographic
Place them directly in <img src> or CSS background-image. Choose
dimensions that match the layout slot. Same prompt + size always
returns the same cached image, so reuse URLs for stable pages.
Styles: web (default), photographic, illustration, abstract, 3d, minimal.
Tips: encode spaces as +, add &seed=2 for a variant.No SDK, no keys in the page. Claude writes the URL, the page renders, the service does the rest.
Access control
Generating a new image calls Gemini and costs money. Set a GEN_TOKEN env var on your instance to gate new generations:
- Cache hits are always open — already-generated URLs serve to anyone, no token. Embedded
<img>tags never break. - Cache misses require a matching
X-Gen-Tokenheader whenGEN_TOKENis set, otherwise they return401.
# Generating a new image only works with the secret curl -H "X-Gen-Token: YOUR_SECRET" \ "https://your-instance.vercel.app/i/1200x600?prompt=team+in+a+bright+office"
GEN_TOKEN in your Vercel project (Production scope) and redeploy. Leave it unset for a private/self-host instance where anyone may generate.Caching & limits
- Deterministic: same params → same image, forever. Pages stay stable across reloads and deploys.
- Cache hitsare instant CDN redirects (~150ms) and don't call Gemini.
- Cache misses generate in ~2–10s, then are cached.
- Generation control: set
GEN_TOKENto requireX-Gen-Tokenon new generations (see Access control). Cache hits are always open.