Skip to content

How do I connect AISwapLab to n8n or another HTTP automation tool?

Use HTTP steps for authenticated catalog, quote, creation, bounded status checks and private download. Store the account key in the automation tool's protected credential mechanism and persist an Idempotency-Key before the generation step. The current API is not an MCP server or a native webhook trigger; build against its documented HTTP contract.

SHIP A RELIABLE INTEGRATIONAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Build a read-only connection; Gate the creation step; Branch on observed state.
Workflow diagram: Build a read-only connection → Gate the creation step → Branch on observed state. Read the article for evidence and limits.

Automation retries can create hidden extra work

Many workflow tools retry failed nodes automatically or restart an entire flow after a timeout. If each execution generates a fresh identifier, one user intent can become several paid tasks. Keep the task record and identifier outside a disposable run whenever recovery may span multiple executions.

What to do next

  1. 01

    Build a read-only connection

    Call /models and /usage before adding creation nodes. Verify that headers and credential substitution work without logging the secret or generating sample media as a connectivity test.

  2. 02

    Gate the creation step

    Quote the exact payload, compare it with the approved ceiling and dispatch with the saved identifier. Disable blind retry behavior that changes the body or request identity.

  3. 03

    Branch on observed state

    Poll existing jobs within rate limits, handle completed, failed and unknown distinctly, and download only completed content. Save a safe job identifier for later reconciliation if the flow stops.

A concrete example

Illustrative automation: a scheduled worker resumes a saved internal task and polls its existing image job. It does not run the image-creation node again simply because a previous execution ended before download.

Before you call it ready

  • Credentials use protected storage.
  • Workflow retries preserve task identity.
  • No native callback feature is assumed.

When to stop or choose another method

If the automation tool cannot persist identifiers or distinguish uncertain acceptance, add a durable backend adapter before enabling paid generation. A linear happy-path demo is insufficient for unattended use.

Sources

One task. A recoverable workflow.

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

Open API documentation