Lets GenDocs
Generation API

Generate images

Create and edit images using owned references.

Read as Markdown ↗

POST /api/generate/image

Requires generate scope and Idempotency-Key. Returns a media task: HTTP 202 for new work, 200 for an accepted replay.

Request

FieldTypeNotes
modelstring, requiredImage ID from discovery, up to 150 characters.
promptstring, requiredEnvelope limit 30,000 characters; generator/model limits may be lower.
parametersobjectDefaults to {}. Accepted generator inputs depend on the model.
referenceAssetIdsstring[]Up to 10 owned asset IDs; model limits can be lower. Defaults to [].
maxGemsintegerOptional request ceiling, 0–1,000,000,000.

Unknown top-level fields and unsupported parameter names are rejected. Provider routing is selected by Lets Gen: do not include parameters.provider, model, prompt, or sourceTool.

Common parameters

ParameterUse
ratioSupported aspect ratio from the model's capabilities.
resolutionSupported model resolution.
outputCountImage count, 1–4, subject to model constraints.
negativePromptOptional negative prompt, up to 1,000 characters where supported.
magicPromptOptional prompt optimization; defaults to false for public API images.
sourceImageOwned source asset ID for an edit model requiring a source image.
backgroundauto, transparent, or opaque for supporting models.
variantModel-specific variant for supporting models.

Specialized style/reference/LoRA inputs are model-specific. The service remains authoritative; unknown options are not silently forwarded to providers.

Example

{
  "model": "MODEL_ID_FROM_DISCOVERY",
  "prompt": "A watercolor illustration of a quiet harbor",
  "parameters": {"outputCount": 1, "magicPrompt": false},
  "maxGems": 10
}

Upload images with Upload assets. Pass returned owned IDs in referenceAssetIds for visual guidance, or parameters.sourceImage where the chosen editing model requires it. Remote reference URLs are not accepted. Reference ownership and readiness are checked before generation.

Read Budgets and retries before adding automatic retries.

On this page