ctx.generate.image({ prompt, references?, model? })
Paid generation
This creates one image and gives you back its asset ID. If you pass only a prompt,
it generates a new image from that text. If you pass asset IDs in
references
(at most two), it edits those images instead. The only model you can name today is "krea2", and that name selects a family rather than
one checkpoint: with references
the call runs krea-2-edit, and a prompt on its own
runs krea-2
text-to-image.
Resolves to { generationId, assetId, assetIds }
ctx.generate.media({ model, params, provider? })
Paid generation
This runs any supported image, video, or audio model. Use the same model name and
parameters shown in the
model catalog
and POST /api/v1/generations. Images and videos you
pass in are asset references, { asset_id: "..." }, from your Workspace.
Resolves to { generationId, assetId, assetIds, data? }
ctx.media.firstFrame({ videoAssetId }) · ctx.media.lastFrame({ videoAssetId })
Free
Save the first or exact last decoded frame as an image Asset in the same Workspace.
Repeating the request reuses the result. Requires read
and content:write
on the run's key.
Resolves to { assetId }
ctx.media.stitch({ videoAssetIds })
Free
Join 1–16 videos in the order you pass them and save a new video Asset with
lineage to every input. Different dimensions, frame rates and codecs are normalized
to the first clip's dimensions and frame rate. Audio is retained only when every
clip has audio; otherwise the result is silent. Repeating the same ordered inputs
reuses the result. Requires read and content:write.
Video derivations accept up to 200 MB of input, 120 seconds of total video,
3840 pixels per side, 8.3 megapixels and 60 fps. Output stays under 200 MB;
processing has a three-minute budget and may fail when a limit is exceeded.
Resolves to { assetId }
ctx.assets.get(id) · ctx.assets.list(filters?)
Free
Find images, videos, and audio your Workspace can already access in Genaro, or look
up one asset by its ID.
Resolves to Asset | null · Asset[]
ctx.groups.get(id) · list() · items(id, page?) · addAsset(groupId, assetId)
Free
Browse your Workspace's groups, read the assets inside them, and add a Genaro
asset to a group. Adding an asset that is already there changes nothing instead of
adding a duplicate.
Resolves to Group · { items, cursor, hasMore } · Group
ctx.llm.chat({ messages, model, temperature? })
Text model
Call a Genaro text model; usage is billed to your balance per call, from the tokens
it used. Messages use roles system, user, and assistant.
A run may make at most 30 text model calls.
Resolves to { content, model }
ctx.llm.describeImage({ assetId | assets, prompt, model })
Text model
Describe one or more image assets with a vision model. Genaro resolves the media;
your script only passes asset IDs and a prompt.
Resolves to { content, model }
ctx.llm.describeVideo({ assetId, prompt, model })
Text model
Analyze a video asset with a video-capable text model, the same way.
Resolves to { content, model }
ctx.review.approval({ title, instructions?, subjects?, approveLabel?, rejectLabel? })
Ask for one explicit go or no-go decision. Optional subjects can be asset-backed
options so the reviewer sees the work being approved.
Resolves to { decision: "approved" | "rejected" }
ctx.review.selectOne({ options, title, instructions?, submit? })
This durably stops the run and asks a person to pick one of the options you passed
in. It appears in the console under Apps › Reviews and survives server restarts. The
App can wait for hours or days without costing anything, then continue under the
authorization of the API key that started the run.
Resolves to string
ctx.review.selectMany({ options, title, instructions?, min?, max? })
Ask for a shortlist. The person submits a unique set of option values within the
minimum and maximum you provide.
Resolves to string[]
ctx.review.checklist({ criteria, title, instructions?, subjects? })
Require a QA result for every criterion. N/A appears only on criteria where the
App explicitly allows it.
Resolves to { results: Record<string, "pass" | "fail" | "not_applicable"> }
ctx.review.reviewEach({ items, title, instructions? })
Require an individual disposition for every item before the run continues.
“Changes requested” also requires actionable written feedback for that item.
Resolves to { decisions, feedback }
ctx.trace.span({ name, key?, attributes? }, (span) => …)
Free
Group steps into a named span so the run's execution trace reads like your
process. Use the span
context inside the callback so its steps belong to the span.
Resolves to { value, spanId }
ctx.random()
Free
This gives you a random number that is at least 0 and less than 1. Genaro keeps
that number consistent for the entire run.
Resolves to number
ctx.now()
Free
This gives you the current time in epoch milliseconds. Genaro keeps that
timestamp consistent for the entire run.
Resolves to epoch milliseconds