Skip to main content

Complete one task

After sign-in and skill discovery, follow: requirements → model parameters → references → free estimate → approval → one submission → original task query → original download. Commands below illustrate steps, not permission to generate.

Step 1: choose a model and inspect inputs

Replace MODEL_ID with a canonical search result. Check reference_inputs, required fields, enums, ranges, and exclusive options. Being first, cheap, new, or beta does not establish suitability. Selection order, newer families, and cost rules are maintained in models, costs, and quotas. Check availability for requested models; examples are not default recommendations.

Step 2: prepare and upload references

CLI reads files on its execution machine. Check path, permissions, format, size, and model requirements before uploading:
Regular local files must be 1 byte–95 MiB. Image/video/audio still have model-specific format, count, dimensions, and duration limits. Use the returned file_url in supported fields such as image_url or image_urls, not a desktop path. References generally last 72 hours. Retain upload_id and inspect the original receipt after a lost response. Report unknown if compatible file-service recovery is unavailable; do not repeat uploads just because of a timeout. Check whether a public HTTPS reference is accepted directly.

Step 3: prepare input and estimate for free

This image example first checks z-image-turbo availability. It demonstrates the flow, not a default recommendation:
Create input.json in the working directory:
Read input_valid, problems, estimate.status, basis, warnings, and quote_id. Show model, output, references, count, cost range, and omissions, then wait for approval. partial and no_price cannot be described as guaranteed totals; token_billed is a reference price that settles at actual tokens. See CLI costs.

Step 4: submit once after approval

After the user approves this plan, submit the image using its quote:
—confirm declares approval already obtained. Generation does not accept a new model/input. A quote holds for 24 hours from the estimate: the same input is submitted when its price is the approved one or lower. Re-estimate and obtain approval when the specification or account changes, the price rises (price_changed), or the quote expires (quote_expired). Do not submit one quote as image, video, and audio.

Several images or tasks of one model

Write the inputs (1–50, each like a single input) to a JSON array or JSONL file, estimate them together, and wait for one approval of the batch total:
generate submits every input at once and returns each input’s task ID or error without waiting. If some inputs were not submitted, finish with tasks resume --quote QUOTE_ID within 23 hours of the first submission: accepted inputs return their original tasks without a new charge. Within that window, never resubmit them with a new estimate or generate command. If the quote has expired or the price has risen, tasks resume sends nothing: check tasks batch or tasks list for the inputs that went through, then estimate only the rest as a new batch. Some models, such as GPT Image, often return fewer images than n, so use one input per image. If the user explicitly says not to estimate or confirm, add --skip-estimate to generate with --model and --input-file or --inputs-file, and skip the quote; see the CLI reference.

Video tasks

Prepare video-input.json from the actual model schema. Check prompt, duration, ratio, quality, audio, and references. Image-to-video, reference video, editing, and extension may use different models and inputs.
Show estimate coverage, wait for this task’s approval, then:
Save task_id and query it; do not regenerate to wait. Reference duration, quality, and audio can affect cost, and published estimation does not cover every multiplier. Deliver the original video first without automatic local editing, interpolation, or captions.

Music, songs, and speech

Choose music and speech models separately. Prepare audio-input.json according to schema, including supported lyrics/description, language, voice, instrumental mode, references, and exclusive options.
After approval for this quote:
Do not force duration into a model that does not support it. media_seconds is a billing hint, not output-length control. Explain unknown output duration or usage and retain all audio results.

Step 5: query, wait, and recover

processing includes queueing; completed, failed, and cancelled are terminal states. Failed tasks differ from failed query commands. Time filtering applies to the current page; an empty page does not prove no submission. Timeout, Ctrl-C, and closing a window do not cancel tasks. CLI currently has no queue-cancellation command. Retain the original account and quote records after a lost submission response:
outcome_unknown does not mean no charge. Do not delete records, change Keys/path, or create a replacement quote to resubmit; recover first. tasks resume replays the original request ID within 23 hours of the first submission, while the quote is unexpired and the price has not risen. After 23 hours it refuses with recovery_window_passed; with an expired quote or a higher price it refuses with quote_expired or price_changed. In each case nothing is sent, and you check recent tasks before estimating again. A failed task is not charged and its reserved credits are returned automatically; without accounting evidence, do not say the refund has arrived.

Step 6: download and deliver originals

Choose single-result or all-result mode. Prepare parent directories; files are not overwritten. Originals are limited to 1 GiB each and checked for type/content. Batch resume uses its original records, not arbitrary matching filenames. Indexes start at 1; extensions must match actual formats. Original URLs generally last 24 hours. Save promptly and deliver location, original link, model, specifications, and reported actual cost. balance/usage are not a complete bill. Check originals rather than regenerating for gray thumbnails. See CLI reference and download troubleshooting.