Skip to main content

JSON output

The CLI prints JSON on stdout by default, so it composes with jq and shell pipelines.
contenthero model list | jq -r '.[].modelId'
BAL=$(contenthero account balance | jq -r '.credits')

Exit codes

CodeMeaning
0Success
1General error
2Usage error (bad flags or arguments)
3Auth error (no or invalid credentials)
4Timeout (work accepted but not finished in time)
Exit code 4 is not a failure: the generation was accepted and is still rendering. Poll it.

Cost preflight

Preview any cost for free. The preview takes the same parameters as the real call, so the quote matches the charge.
contenthero generate image --prompt "..." --model nano-banana-2 --cost

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:
contenthero generate video --prompt "..." --model kling-3.0 --no-wait   # return an id now
contenthero generation wait <outputId>                                 # block until done
contenthero generation status <outputId>                               # snapshot
The outputId is always returned, so you can always keep polling. A status response includes a pollAfterSeconds hint telling you when to check again.