Until now, every Ducklygen render started with a person clicking Generate. That is fine for one mascot and a handful of variations. It is slow when you need forty sticker frames, a nightly batch of banners, or a build step that makes a fresh header for every release. For those jobs the studio now has a public API and a command line tool, so a script can do the clicking.
This post is the short tour: who it is for, how a render moves through the API, how the key works, what it costs and what it will not do. The full reference lives on the developers page and in the API docs; the CLI page covers the terminal tool.
Who this is for
- Developers who want an image or a short clip inside their own product, a game pipeline or a content tool.
- Designers who script a repeated job: the same mascot in every season, the same card in every language.
- Teams with a build or CI step that should produce art without anyone opening a browser.
- People using a coding agent that can run a command and read JSON back.
If you make a handful of pictures a week, the studio at /app is still the quicker way. The API pays off when the same job repeats.
What you can do with it
The API covers the whole life of a render and nothing more exotic than that. You can list the models in the catalog, read one model's fields, ask for the exact price of a request, start a render, check its status, download the finished file, list your recent renders and delete one. It also tells you who you are and what is left on the balance. The models are the same ones you see on the models page: 2 for images and 4 for video, with the field list of each one available from the API itself.
How a render works
A render is asynchronous, which is the one idea worth holding on to. You send the request and the API answers at once with an id and the status queued. The picture or clip is made in the background. You then ask for that id every few seconds until the status says succeeded, failed or refunded. On success you download the file from the content address with the same key.
- Pick a model and read its fields, so you know which settings it takes.
- Ask for the price of your exact inputs. Nothing starts and nothing is charged.
- Start the render with a POST. The reply carries the id.
- Poll the id until the status is final.
- Download the result from the content route of that id.
curl -X POST https://ducklygen.com/api/v1/api/catalog/generations \
-H "Authorization: Bearer $DUCKLYGEN_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"modelId": "image-model-id", "inputs": {"prompt": "rubber duck floating on teal water, soft light"}}'curl https://ducklygen.com/api/v1/api/catalog/generations/ID/content \
-H "Authorization: Bearer $DUCKLYGEN_API_KEY" \
-o result.pngThe Idempotency-Key header in the first call is worth the extra line. If your script times out and retries, the same key means the retry does not charge a second time.
Authentication in plain words
You create a key in the settings of your account, under API keys. Every request carries it in an Authorization header as a Bearer token. That is the whole scheme: no sign-in flow, no cookies. A Ducklygen key starts with dk_live_ and works only on this site. You can revoke a key at any time, and each key has its own per-minute limit and an optional daily cap.
The same balance as the studio
There is no separate API plan. Renders started from code are paid per render from the same balance as the studio, and the price of a given request is the price you would see on the Generate button. The minimum top-up is €3.00. Amounts in the API are in euro cents, so a charge arrives as a number of cents rather than a formatted string. Ask for a quote before a big batch and you will know the total before anything runs. If a render fails, it is refunded to your balance automatically.
The command line tool
If you would rather not write HTTP calls, install the tool with npm and sign in once with your key. Then a render is one command: the model, a prompt and an output folder. A local file you name as an input is uploaded for you.
npm i -g ducklygen
ducklygen login
ducklygen run <model> -p "rubber duck floating on teal water, soft light" --dry-run
ducklygen run <model> -p "rubber duck floating on teal water, soft light" -o ./out/The tool prints progress and errors on stderr and a single JSON document on stdout, and exits non-zero on a failure, so it sits well inside a shell script or a CI job.
Limits and what it cannot do
- Rate limits are real. Past the per-minute limit, or a key's daily cap, the API answers with an error. Slow down and retry; do not loop faster.
- Not enough balance stops the render. The API answers 402 and nothing starts.
- Results are not instant. A still takes seconds and a video clip takes longer, so poll rather than wait on one open request.
- One request, one render. There is no batch call; a batch is a loop in your code.
- Clips have a length ceiling, and a model's fields tell you which sizes and durations it accepts.
- Add a User-Agent of your own if a plain script gets a 403 page; some default ones are stopped before they reach the API.
The API also does not decide what to draw. A script that repeats a weak prompt will repeat a weak picture, only faster. Test the wording by hand in the studio first, the way the draft loop does, and only then put it in a loop. For a set that has to stay on-model across many calls, the consistency guide shows how to keep one canon picture as the reference.
Where to start
Create a key, top up the minimum, and run one dry run from the terminal to see the price. Then make one real render from the command line, and once that works, put the same request in your code. The reference for every route is on the API docs page, and the developers page has the quickstart and the CLI commands side by side.




























































