Skip to main content
Use API key authentication for all queries on this page. Retain the content ID and task ID returned by the generation mutation. Poll with reads, which do not submit another generation.

Read an existing generation

GenerationResult
Variables
Use the account’s nested content field for this flow. Media visibility is checked for the authenticated account. A null content result provides no successful-completion proof; inspect errors and the saved receipt before taking another action.

Interpret task status

current and total describe progress; queued indicates a waiting running task. A full progress counter alone does not prove success. finishCode can be absent before completion. Common finish codes are 0 (success), 1 (failure), 2 (pause), and 3 (cancel). Use a bounded interval and waiting deadline chosen for your client. Reaching that deadline does not cancel server-side work. Resume reading the same content instead of repeating the creation mutation.

Read a known task

TaskById
Variables
For a content-generation task, resourceId is the content ID. Use the top-level task from submission rather than an internal processing task.

Obtain download URLs

After successful completion, request a download URL for an output media ID:
DownloadMedia
Variables
The result is a list of URLs. Missing, inaccessible, or unavailable outputs can be omitted. For an unambiguous ID-to-URL association, request one media ID at a time; do not zip a multi-ID input with the returned array. An empty list means there is no eligible URL in that response. Links expire. Query the same media ID to get a fresh link; this does not create new media. Watermark behavior can depend on the requesting account and output owner. Inspect the downloaded media before using it.

Reconcile your media history

When a submission receipt is missing, inspect account history rather than automatically resubmitting:
PersonalMediaHistory
Variables
Send nextCursorId as page.previousId for the next page and stop when hasMore is false. Keep filters unchanged across pages. Optional filter: PersonalMediaFilter accepts modelId, mediaTypes, and fileTypes. Omitted mediaTypes uses the personal history’s default media types; omitted fileTypes allows all file types. An empty list matches no media. History can help identify an existing operation, but an empty page does not prove that an uncertain mutation was never accepted.