Skip to content

Can I cancel an API generation after it has been submitted?

The current AISwapLab public API does not document a cancellation endpoint. Closing a browser tab, stopping a poller or revoking the key does not establish that an accepted provider task was canceled. Preserve the job ID, inspect its outcome and distinguish stopping local delivery from stopping remote generation or returning credits.

RECOVER AND DELIVER API JOBSAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Check whether submission occurred; Stop only what you control; Explain billing honestly.
Workflow diagram: Check whether submission occurred → Stop only what you control → Explain billing honestly. Read the article for evidence and limits.

Cancel needs a defined meaning

Users may mean remove a waiting local request, stop a remote model, hide a result or obtain a refund. These are different operations. Your application can cancel its own unsent queue item, but it should not show that local action as confirmed cancellation of work already accepted by AISwapLab.

What to do next

  1. 01

    Check whether submission occurred

    Use your durable task record to distinguish locally waiting work from a returned job. A lost response may still represent accepted work, so recover the original identifier before declaring it unsent.

  2. 02

    Stop only what you control

    For an unsent item, remove it from your own dispatch queue according to your application's rules. For accepted work, stop optional notifications if requested while retaining the task record for reconciliation.

  3. 03

    Explain billing honestly

    Completed jobs and creative retries use credits; confirmed technical failures have their own return handling. Do not promise a cancellation refund merely because the user no longer wants the result.

A concrete example

Illustrative case: a user presses Stop after an H3 job reaches running. The frontend stops showing a spinner, but the model may continue. The interface should explain the observed state rather than claim generation and charging were reversed.

Before you call it ready

  • Local queue cancellation is distinguished from remote work.
  • Accepted task IDs are retained.
  • No unsupported cancellation or refund is promised.

When to stop or choose another method

If confirmed remote cancellation is essential to your product, do not launch that promise against the current contract. Obtain explicit service support or choose a workflow that provides it.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation