Authentication
A Bearer token in the Authorization header. Create keys in Settings and revoke any of them at any time.
Authorization: Bearer dk_live_...Images, video, audio and 3D behind one API, paid from the same balance as the studio. Create a key in Settings; the CLI is coming soon.
Coming soonThe Ducklygen CLI is on its way. This page previews how it will work; until then, use the API.
npm i -g @ducklygen/cliSwap the model ID to switch between image, video and speech. The fields follow the model.
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"
}
}'const res = await fetch("https://ducklygen.com/api/v1/api/catalog/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.DUCKLYGEN_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ modelId: "image-model-id", inputs: { prompt: "rubber duck floating on teal water, soft light" } }),
});
const job = await res.json(); // { id, status: "queued" }import os, requests
job = requests.post(
"https://ducklygen.com/api/v1/api/catalog/generations",
headers={"Authorization": f"Bearer {os.environ['DUCKLYGEN_API_KEY']}"},
json={"modelId": "image-model-id", "inputs": {"prompt": "rubber duck floating on teal water, soft light"}},
).json() # { id, status: "queued" }
Sign in with your email, open Settings, API keys and create a key. Top up from €3 in Billing.
export DUCKLYGEN_API_KEY="dk_live_..."The command-line tool is not published yet. Until it is, everything runs in the studio.
npm i -g @ducklygen/cliPick a model ID from the catalog and send a prompt. Add --dry-run to see the price without spending anything.
ducklygen run <model> -p "duck on teal waves" -o ./out/Run any model from a shell, a CI job or a coding agent. Every render is priced before it starts and drawn from the same balance.
The @ducklygen/cli package is not published yet. The commands below show how it will work.
Full CLI guide →ducklygen loginPaste your API key once; it is checked and savedducklygen whoamiThe key's name and your balanceducklygen models --type videoEvery video model with its starting priceducklygen run <model> -hA model's fields, fetched live: type, default, allowed valuesducklygen run <model> -p "<prompt>" -o ./out/Render and save the result in a folderducklygen run <model> -p "..." --dry-runThe exact price, without spending anythingducklygen run <model> -p "..." --max-price 0.50Refuse to run if the price is higherducklygen run <model> -p "..." --json -o ./out/One JSON result, ready for the next stepducklygen skill installTeach your coding agent to use the CLIA Bearer token in the Authorization header. Create keys in Settings and revoke any of them at any time.
Authorization: Bearer dk_live_...Starting a render answers at once with status queued. Poll the render until it has succeeded, failed or been refunded.
{ "status": "queued" }Ask for the exact price of your inputs without starting anything. Every amount is in euro cents.
POST /v1/quoteSend an Idempotency-Key header and a retried request never charges twice.
Idempotency-Key: render-042Each key has a per-minute limit and an optional daily cap. Past the limit the API answers 429.
429 Too Many RequestsJSON errors with a code and a message. A render that fails is refunded to your balance automatically.
{ "status": "refunded" }Base URLhttps://ducklygen.com/api/v1/api/catalogFull API reference →
/meYour key and balance/modelsEvery model/models/detail?id=MODEL_IDOne model and its fields/quotePrice for exact inputs/generationsStart a render/generationsYour recent renders/generations/IDOne render's status/generations/ID/contentThe result file/generations/IDDelete a renderCreate an API key in Settings and call any model. The CLI is coming soon. Failed renders are refunded.