
Aborting fetch stops your application's request or response handling; it does not prove that an accepted Imagild generation was cancelled. The current Imagild API exposes no cancellation endpoint. Retain the existing operation and task ID, and label the user action “Stop waiting” when that is what it actually does.
This matters when a modal closes or a component unmounts. Cleaning up the browser's network activity is sensible, but it is separate from the remote task contract documented in the Imagild API console.
Key Takeaways
- An AbortController changes the local request lifecycle, not the recorded generation outcome.
- Keep accepted task IDs so the application can resume authorized reads later.
- A lost submission response requires recovery with the original operation identity.
Separate three user actions
A person may want to stop a spinner, stop downloading a file, or stop paid generation. These intentions should not share a misleading button.
| User action | Safe description in your application | What it does not establish |
|---|---|---|
| Leave a waiting view | Stop watching this task | Remote generation was cancelled |
| Abort a status GET | Stop the current status check | The task failed |
| Interrupt a media download | Stop receiving this copy | The stored output was deleted |
| Request cancellation of generation | Explain the current API limitation | A supported cancellation command exists |
MDN documents AbortController.abort as stopping asynchronous requests, response-body consumption or streams. That describes the local web API; it does not define the model service's billing or job-control policy.
Some providers offer explicit cancellation or deadline behavior. Replicate's lifecycle documentation is one example, but those operations are not Imagild endpoints.
Abort a read without changing the task record
Here is a server-side raw-fetch helper for one existing task. The caller supplies a valid secret from secure server configuration and a real saved task ID.
async function readTaskWithLocalTimeout(taskId, apiKey, timeoutMs) {
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), timeoutMs);
try {
const response = await fetch(
"https://imagild.com/api/relay/v1/tasks/" +
encodeURIComponent(taskId),
{
headers: { Authorization: "Bearer " + apiKey },
signal: controller.signal
}
);
const payload = await response.json();
return { local: "read-completed", http: response.status, payload };
} catch (error) {
if (controller.signal.aborted) {
return { local: "read-aborted", taskId };
}
throw error;
} finally {
clearTimeout(timer);
}
}
This function never marks a task cancelled or failed. Its returned local field belongs to your application, not to the Imagild schema. After a completed read, still inspect the HTTP status and payload.data.status.
Be more careful when submission is interrupted
Aborting a POST before receiving its response leaves a different uncertainty: you may not know whether it was accepted. Do not conclude that an abort prevented all server-side work.
Your application should have saved the operation's idempotency key and exact request parameters before submission. Recover by sending the same logical request with that same key and unchanged parameters at the original generation endpoint. Do not generate a new key on component remount.
If the task ID was already received, use GET to inspect that task instead. If it reports unknown, keep it for reconciliation; an abort does not make its reservation immediately refundable. The failed-job checklist helps distinguish these outcomes.
Test the wording and the spending boundary
Using mocked reads, open a waiting panel, stop waiting and reopen it. Confirm the same task card resumes and no generation POST occurs. Simulate a successful result after the panel was closed; reopening should discover that result rather than claiming it was cancelled.
Review cost messaging too. Current image generations use 10, 15 or 20 points by requested tier, as shown in the points guide. Stopping local waiting does not authorize your application to release or re-charge those points.
A correct control gives users an honest choice: leave the waiting screen now, then return to check the same accepted work later.
Related tasks
- What Should You Check Before Retrying a Failed Image or Video Job?
- Imagild Points, Resolution and Jobs: Plan a Creation Before You Spend
Sources and scope
- Imagild API console and integration guide: Current Imagild entry point, active-member access, asynchronous task reading and authenticated output contract; implementation facts cross-checked in lib/relay and the 2026-10-28 claims manifest.
- Replicate Prediction Lifecycle: General distinction between an ongoing prediction and its reported outcome. Its provider deadlines, cancellation, billing and retention rules are not attributed to Imagild.
- MDN AbortController.abort(): AbortController can abort fetch requests, response consumption and streams; it does not define the remote media service's job cancellation or billing contract.
- Imagild model hub: Current image resolution point rates and H3 video point schedule; no uptime, comparative price rank or output quality guarantee is inferred.
Product instructions were checked against the current Imagild API contract and the public model catalog. Code, budgets and acceptance checks are illustrative; this article does not claim a new paid generation test, an uptime measurement, a search-volume study or a ranking of AI citations.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: Original Imagild product screenshot captured on 28 October 2026; model availability and prices may change. This image is not an API response or a performance benchmark.