Images

Generate new images that match the visual style of a reference image: supply a style_image (URL or base64) plus a text prompt describing what to create and an optional image_type (defaults to sprite). The job result is an array of image results, each with a url; request n (1-4) to control the number of variations. The style_image is uploaded and validated, and an image larger than 15MB is rejected with HTTP 400. Credits are held when the job is accepted and refunded if it fails or is cancelled; the charge scales with the number of images produced. Use this instead of createImage when style consistency with an existing asset matters; use editImage to alter the content of a specific image rather than borrow its style, and removeBackground to isolate a subject. Pass an optional request_id to tag the results so you can retrieve them later via listGenerations (type image). Requires an API key (user scope). The call returns 202 with a job id - poll getApiJob (pass wait 30 to long-poll) honouring poll_after_ms, until status is succeeded; its result field is exactly the response documented for this operation. Synchronous responses are deprecated but still supported: pass `async: false` to block until the result is ready and receive it as the response body. Synchronous calls run on the same queue: the response carries an X-Ludo-Job-Id header, and a job still running after 15 minutes comes back as 202 with the job instead of an error. Each account may have up to 50 generations queued or running at once via the API; a request beyond that returns 429 (code PENDING_JOBS_LIMIT).

post/assets/image/style

Request body

style_imagestring required

URL or base64-encoded reference image whose visual style should be matched.

promptstring required

Text description of what to generate (e.g., "a warrior character", "a forest background", "a treasure chest").

image_typestring

What kind of image to generate.

nnumber

Number of variations to generate (1-4).

augment_promptboolean

Augment the prompt behind the scenes. Disable to have more control.

request_idstring

Optional client-provided identifier, unique per request. Re-sending the same request_id returns the existing job instead of generating again. Also usable as the request_id filter of listGenerations.

asyncboolean

Defaults to true: the call returns 202 immediately with a job id to poll with getApiJob. Set false for a synchronous response (deprecated but supported): the call then blocks until the result is ready.

Response

Success

urlstring
request_idstring
created_atinteger

Changes

Changed in 1 of the 17 revisions of this API.1