Generate placeholder images for your seed data in one prompt
Seed data with broken or identical images makes demos and screenshots look unfinished. Hand your coding agent this prompt and it adds a script that generates a small pool of placeholder images, hosts them with an expiry, and fills your fixtures. It reuses the pool, so a re-run costs nothing.
Claude CodeCursorWindsurfCopilot - 1Copy the prompt
The one big button below.
- 2Paste it into your agent
In your project — Claude Code, Cursor, etc.
- 3Drop in your key
Set your secret key as
PIXELVAULT_API_KEYin your local.env. Server-side only.
Fill my seed data and test fixtures with generated placeholder images, hosted on PixelVault.
Context - read this first and use only the documented API:
- Overview + API: https://pixelvault.dev/llms.txt (section "Generate an image from a prompt")
Do this:
1. Find my seed or fixture data (a seed script, a JSON/YAML fixtures file, a Storybook data file) and list the records that need an image URL: for example products, users, posts or listings.
2. Create a script (for example scripts/seed-images.mjs, with an npm script "seed-images") that:
- generates a SMALL POOL of images (default 6) from varied prompts that fit my data's categories, plus one shared style sentence in a single constant. Placeholders do not need to be unique, so reuse the pool across records round-robin instead of generating one image per record;
- calls POST https://api.pixelvault.dev/v1/images/generate for each pool image with "folder": "seed" and "expires_in": 2592000 (30 days), so the dev images clean themselves up;
- writes the pool's data.url values into a small file (for example seed-images.json) and assigns them to records that have no image yet. It must be safe to re-run: if the pool file already exists, reuse it and generate nothing.
3. Update my seed script or fixtures to read from that file. Do not edit records that already have an image.
4. Tell me how many credits the run used, from data.generation.credits_remaining in the last response.
Result I want: every seeded record has a working image URL, the whole run costs at most the pool size in credits, and re-running it costs nothing.
Rules:
- Call the API from server-side or build-time code only. The key is a SECRET key (pv_live_...): read it from the PIXELVAULT_API_KEY environment variable, never hard-code it, never put it in browser code or in a public env var (no NEXT_PUBLIC_, PUBLIC_ or VITE_ prefix), and make sure .env is listed in .gitignore.
- Use only the documented endpoint: POST https://api.pixelvault.dev/v1/images/generate with header "Authorization: Bearer $PIXELVAULT_API_KEY" and JSON body {"prompt": "...", "model": "flux-1-schnell"}. The hosted image is in data.url (data.optimized_url is a smaller WebP/AVIF). Do NOT invent options, endpoints or packages.
- Each image costs 1 credit on the default model and the free plan has 10 credits a month. Before generating a batch, call GET https://api.pixelvault.dev/v1/usage and stop if data.generation.credits_remaining is lower than the number of images you plan to make. Never generate in an unbounded loop: cap the number of images per run.
- Errors: 402 (out of credits, or a model my plan does not include) means stop and tell me, do not retry. 429 means wait for the Retry-After header. 502, 503 and 504 are safe to retry (credits are refunded), at most twice. 422 prompt_rejected means change the prompt.
- Generated images are not repeatable. Never regenerate an image that already has a saved URL unless I ask.
- Keep the change minimal and match my existing code style.
- This is for development and demo data only. Do not use these images for production content, and do not run this in my app's runtime. What the agent will do
- Generate a small pool of images (default 6) that fit your data's categories
- Host them with a 30-day expiry so dev images clean themselves up
- Assign them to seed records round-robin and save the URLs to a file
- Re-run for free: an existing pool is reused, nothing regenerates
Grab your free key
This one needs your secret key (pv_live_…), not a publishable one, because generating images spends credits. Keep it server-side: set it as PIXELVAULT_API_KEY in your local .env or your CI secrets, never in browser code.
Free plan: 10 generation credits a month (1 per image on the default model), plus 200 MB of storage. No card. Verify your email to generate.
Prefer to wire it up yourself?
The two options that matter for seed data are folder and expires_in (in
seconds, up to 30 days). One call looks like this:
const res = await fetch("https://api.pixelvault.dev/v1/images/generate", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.PIXELVAULT_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "Product photo of a ceramic mug on a plain background, soft light, no text",
folder: "seed",
expires_in: 2592000,
}),
});
const { data } = await res.json();
console.log(data.url); // permanent link until it expires See the generate endpoint reference for every option and error code.
Why a pool instead of one image per record?
Placeholders do not have to be unique, and every image costs a credit. Six well-chosen images reused across a hundred records look fine in a demo and cost six credits, which fits inside the free plan's 10 a month. The prompt tells the agent to do this and to save the pool so a second run generates nothing.
Be realistic about the images
Generation uses open Cloudflare Workers AI models. They are good for products, scenery and illustrations, and poor at faces and text, so for avatars it is usually better to use initials or a fixed set of images. Placeholders are for development and demos, not production content.
FAQ
Do the images disappear?
Yes, after 30 days, because the prompt sets expires_in to the maximum. Re-run the script after the pool expires to make a fresh one.
Can I seed in CI?
Yes, with the key in your CI secrets. Commit the pool file so CI reuses it instead of spending credits on every run.
What if I run out of credits?
The API returns 402 and the prompt tells the agent to stop and tell you instead of retrying. Credits reset on the 1st (UTC).