Pixloomdocs

Render a URL

GET /api/v1/render is a URL that returns an image. Paste it anywhere a URL is loaded.

https://pixloom.dev/api/v1/render?prompt=cozy+bookstore+at+sunset&style=watercolor&key=sk_live_...

The first request generates the image and takes a few seconds. Every request after redirects straight to the finished file. No polling, no job, no JSON.

This is the endpoint for places that only understand URLs: an email, a Slack message, a Notion page, a Figma fill, an iOS shortcut, a CMS field that wants an image address.

This endpoint needs a secret key, and the key usually has to sit in the URL. Only use it where the URL stays private. For a public page, use the image proxy, which takes no key at all.

Parameters

ParamTypeDefaultNotes
promptstringrequiredMissing gives a 400.
stylestringnoneA preset id or one of your own.
strengthnumber10 to 1.
characteruuidnone
widthinteger1024Clamped to 256 to 2048, rounded to a multiple of 64.
heightinteger1024Same.
formatpng, jpeg or webpwebpAnything else becomes webp.
agestringnoneComma-separated kids, bigkids, adults. Unknown values are dropped.
keystringYour key, when you cannot set a header.

Unlike generate, out-of-range numbers are clamped rather than rejected. A URL in an email cannot handle a validation error, so it gets the nearest sensible image instead.

Character requests follow the character's saved match or lock behavior. The first request may take longer to prepare its appearance. Subsequent scenes reuse that preparation. Changing source images invalidates the character's cached appearance. Character requests skip the permalink's active-image shortcut and use the character revision when checking cached images.

What you get back

Always a 302 to the image, cached for ten minutes. What sits behind the redirect depends on what already exists, in this order:

  1. An image you pinned for this permalink, while its refresh window holds.
  2. The cached image for this exact prompt and style.
  3. The best performing image for this prompt, by clicks and impressions.
  4. A brand new generation.

Only the last one costs a generation. A popular URL is almost always a redirect to a file we already have.

Running out of generations

If you are out of quota, the endpoint first looks for any image you already made from this exact prompt and serves that. Only when there is nothing at all do you get a 402. A page that has been running for a while keeps showing images after you hit your limit.

Responses

StatusBody
302Redirect to the image.
400Missing prompt or invalid character UUID.
401Missing or invalid key.
402Out of generations and no earlier image to fall back on.
403Account not approved, publishable key, or a domain that is not on the key.
404Character not found or belongs to another account.
429Over your per-minute rate limit.
502Character references could not be read, or image generation failed. Try again.

On this page