Lets GenDocs

Quick start

Make your first Lets Gen API request.

Read as Markdown ↗

1. Create a personal API key

Open Lets Gen, sign in, and open Settings → API keys. Create a key with read and generate access. Set a monthly Gem cap and an expiration appropriate for your integration. Copy the secret when it is shown: it is displayed only once.

Store it on your server as LETSGEN_API_KEY. Never include it in a browser bundle, public repository, screenshot, or prompt. Use a secret manager or your platform's environment settings.

You can also manage these same personal keys on WeGen, using its standalone API keys page in the workspace or account menu.

2. Discover models

All URLs in this reference use the API base URL https://letsgen.app. Prefer a terminal workflow? Start with the Lets Gen CLI.

curl https://letsgen.app/api/generate/models \
  -H "Authorization: Bearer $LETSGEN_API_KEY"

Choose an image model ID from the response. Check available when present and its capabilities; some video entries do not report an availability flag. Do not infer availability from an absent flag. Model IDs and capabilities can change; discover them instead of copying provider model names.

3. Submit an image

This example spends account Gems. Set maxGems to your approved per-request ceiling, and replace MODEL_ID with an image model from discovery. A low ceiling can return PRICE_CHANGED; do not silently raise it.

curl https://letsgen.app/api/generate/image \
  -H "Authorization: Bearer $LETSGEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: my-project-image-001' \
  --data '{
    "model": "MODEL_ID",
    "prompt": "A white ceramic mug on a sunlit kitchen table",
    "parameters": {"outputCount": 1},
    "maxGems": 10
  }'

Persist the body and idempotency key before sending. A new request returns HTTP 202 with {task, created: true}. Record task.id immediately. An accepted media replay normally returns HTTP 200 with the same task and created: false.

4. Read the task and save outputs

curl https://letsgen.app/api/generate/tasks/TASK_ID \
  -H "Authorization: Bearer $LETSGEN_API_KEY"

Poll with backoff, for example 2, 4, 8, then 15 seconds. Stop at succeeded, partial, failed, or cancelled. Download successful task.outputs[].asset.url values and retain the files. URLs can expire: read the task again for a current URL rather than generating again.

Next steps

On this page