Your first image in five minutes
Five steps to an AI-generated image on your page. Then the same thing from the terminal.
Create an account
Join the beta. Free accounts get 100 generations a month and unlimited instant images, no card needed.
The beta is invite-only, so every account is approved by hand. You get an email the moment you are in. Until then the API refuses your keys, so wait for that email before moving on.
Create a publishable key
Open Settings, Integration and click Create key. Choose Publishable, name it, and list the domains it may run on, such as example.com. Localhost always works, so you can test before you deploy.
Copy the key when it appears. It starts with pk_live_. Publishable keys can only fetch images, so they are safe to ship in page source.
Add the script tag
Anywhere in your HTML, with the key from step 2.
<script src="https://pixloom.dev/pixloom-client.js" data-key="pk_live_..."></script>The script scans the page for Pixloom attributes and keeps watching for elements added later, so it works with any framework or none.
Describe an image
Add an image tag with a prompt. No src required.
<img
data-pixloom-prompt="cozy bookstore at sunset"
data-pixloom-style="watercolor"
alt="Cozy bookstore at sunset"
/>The style is optional. Free accounts can use photorealistic, cinematic, modern-illustration, cartoon and watercolor. If you give the tag a src, it stays as the fallback until the image is ready.
Open the page
The first load generates the image, which takes a few seconds. A shimmer marks the spot meanwhile. Every load after that serves the finished image from cache, on this page or any other page that uses the same prompt and style.
The image also appears under Images in your dashboard, where you can download it, save it as a permalink, or generate another take.
The same thing from the API
Need images outside a browser, in a build step, a CMS, or a bot? Use a secret key. Create one the same way as step 2, choosing Secret instead. Secret keys start with sk_live_ and never belong in page source.
Start a generation. The response is a job, not an image.
curl -X POST https://pixloom.dev/api/v1/generate \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{ "prompt": "cozy bookstore at sunset", "style": "watercolor" }'
# 202 { "jobId": "3f6c...", "status": "queued" }Poll the job every second or two. The status goes queued, then processing, then completed with the image URL.
curl https://pixloom.dev/api/v1/job/3f6c... \
-H "Authorization: Bearer sk_live_..."
# 200 { "status": "completed", "imageUrl": "https://..." }Just want a URL that returns an image? This one generates on the first request and redirects straight to the image on every request after. Use it anywhere the URL stays private, since it carries your secret key.
https://pixloom.dev/api/v1/render?prompt=cozy+bookstore+at+sunset&style=watercolor&key=sk_live_...