Skip to main content

JSON output

The CLI prints JSON on stdout by default, so it composes with jq and shell pipelines.

Exit codes

Exit code 4 is not a failure: the generation was accepted and is still rendering. Poll it. Exit code 5 means nothing ran and nothing was charged. The message says why and lists the ways to continue; in JSON mode the error also carries its code and ranked actions.

Cost preflight

Preview any cost for free. The preview takes the same parameters as the real call, so the quote matches the charge.

Async and polling

generate runs a smart-wait of about 50s, then returns the finished asset or an outputId if the render is still going. To return immediately and poll yourself:
The outputId is always returned, so you can always keep polling. A status response includes a pollAfterSeconds hint telling you when to check again.