Generate professional-grade photos through custom prompts
and a production ready API.
Usage
Three patterns — img tag, fetch API, or the drop-in SDK with automatic shimmer loading.
<!-- Prompt + style preset --> <img src="https://pixsum.dev?prompt=a+barista+pouring+latte+art&preset=documentary&w=1200&h=800&key=YOUR_KEY" /> <!-- Preset standalone (uses built-in example subject) --> <img src="https://pixsum.dev?preset=cinematic&w=1280&h=540&key=YOUR_KEY" /> <!-- Custom prompt, 16:9, webp --> <img src="https://pixsum.dev?prompt=empty+Tokyo+street+at+dusk&preset=street&w=1200&ar=16:9&fmt=webp&key=YOUR_KEY" />
// Single image — prompt + style preset const url = `https://pixsum.dev?prompt=${encodeURIComponent(prompt)}&preset=documentary&w=1200&h=800&key=YOUR_KEY`; // Batch: one brief → many coherent images const res = await fetch('https://pixsum.dev/batch?key=YOUR_KEY', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ context: "Team offsite in Kyoto. Warm lantern light. Candid, documentary, 35mm film grain.", images: [ { role: 'hero', w: 1200, h: 630 }, { role: 'thumbnail', w: 400, h: 250, count: 4 } ] }) });
<!-- Drop in the SDK --> <script src="https://pixsum.dev/pixsum.js" data-key="YOUR_KEY"></script> <!-- Single image — prompt + style preset --> <img data-pixsum-prompt="a professional at their desk, warm natural light" data-pixsum-preset="corporate-portrait" data-w="400" data-h="400" /> <!-- Batch story card --> <div data-pixsum-batch> <data value="Team offsite in Kyoto. Candid, warm, documentary, 35mm film grain."></data> <img data-pixsum-role="hero" data-w="700" data-h="400" /> <img data-pixsum-role="thumbnail" data-w="160" data-h="100" /> </div> <!-- Shimmer + fade-in handled automatically -->
Presets
Documentary, cinematic, editorial, street, architectural and more. Each preset is a photographic style recipe — camera, lens, lighting, colour grade — baked into a single word.
Batch API Growth
Describe your scene once. Pixsum expands it into tonally consistent prompts — same mood, same light, same story.
fetch('https://pixsum.dev/batch', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_KEY' }, body: JSON.stringify({ context: , slots: [ { role: 'hero', w: 1200, h: 630 }, { role: 'thumb', w: 400, h: 400 }, { role: 'thumb', w: 400, h: 400 }, { role: 'thumb', w: 400, h: 400 }, { role: 'thumb', w: 400, h: 400 } ] }) })
Image Manipulation Studio
Apply post-processing adjustments at the edge — blur, brightness, contrast, saturation. Parameters baked into the cache key, so every unique combination is served instantly after the first hit.
/* Greyscale — saturation=0 */ https://pixsum.dev?prompt=a+rainy+tokyo+street+at+night&saturation=0&preset=street&key=YOUR_KEY /* Dramatic — high contrast, slight blur */ https://pixsum.dev?prompt=a+boxer+in+a+gym&contrast=1.6&blur=3&preset=documentary&key=YOUR_KEY /* Faded / vintage — low contrast, desaturated */ https://pixsum.dev?prompt=polaroids+on+a+wooden+table&contrast=0.7&saturation=0.5&brightness=1.2&key=YOUR_KEY /* Fetch API */ const url = `https://pixsum.dev?prompt=${encodeURIComponent(prompt)}&saturation=0&contrast=1.4&key=${KEY}`; const res = await fetch(url); const blob = await res.blob(); // cached at edge after first generation
blur=0–100brightness=0.5–2contrast=0.5–2saturation=0–20 for full greyscale.camera=leica, sony, hasselblad, arri, phase-one, canon.lens=35mm, 50mm, 85mm, 100mm-macro, anamorphic, tilt-shift, wide.film=portra-400, fuji-400h, velvia-50, vision3, ilford-hp5, tri-x, ektar.grade=teal-orange, matte, crushed-blacks, bleach-bypass, bw, fuji.Why Pixsum