Skip to content

Images

Image generation is also available as an MCP tool. By default a call uses the interactive lane pool; a request explicitly marked background (and entitled to background lanes) uses the background pool instead — see Lanes & scheduling.

POST /v1/images/generations

Terminal window
curl https://gw.lunaroute.com/v1/images/generations \
-H "LUNAROUTE-API-KEY: $LUNAROUTE_API_KEY" \
-H "content-type: application/json" \
-d '{"model": "…", "prompt": "a lighthouse at dusk", "size": "1024x1024"}'

Common parameters: prompt, model, size, steps, guidance, negative_prompt, seed, and output_format. Available models and their limits (supported sizes, steps range, formats) come from GET /v1/images/models.

  • POST /v1/images/edits — edit by prior image id(s) owned by your organization.
  • POST /v1/images/uploads — upload an image URL or bytes and get an id to edit.
  • GET /v1/images/models — image-capable model catalog.
  • GET /v1/images/{id} — image metadata.
  • GET /v1/images/{id}/content302 redirect to a short-lived signed URL for the image bytes. Clients that don’t follow redirects automatically should read the Location header and fetch it.

Generated images are stored temporarily and expire 7 days after creation. While stored, GET /v1/images/{id} and GET /v1/images/{id}/content serve them; once expired, the image is gone and the id no longer resolves. Download anything you need to keep, or re-upload it with POST /v1/images/uploads if you want to edit it later.

When image generation is switched off for an operator or organization, the routes answer 503 with a <feature>_disabled code.