Skip to content

How should my app save generated outputs to its own object storage?

After a task completes, retrieve the authenticated content through your backend, validate it and store it in your application's appropriately private object storage if your product needs its own copy. Record the job ID and file metadata with the saved object. Do not expose the AISwapLab bearer key in a browser URL or reuse an upstream provider's temporary URL as permanent delivery.

SHIP A RELIABLE INTEGRATIONAISwapLab team · Editorial methodUpdated 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Validate before persistence; Store under an owned object key; Deliver with your authorization.
Workflow diagram: Validate before persistence → Store under an owned object key → Deliver with your authorization. Read the article for evidence and limits.

Your copy creates your own retention responsibility

AISwapLab stores private media in COS and expires access 24 hours after first saving, with automatic permanent cloud deletion. Files already present when this policy began receive one 24-hour migration grace period. Download an authorized copy before expiry if your workflow needs it longer. If you copy a result elsewhere, that copy follows your storage rules, permissions and deletion process. Keeping another copy is a deliberate product decision, not evidence that deleting the original removes every downstream asset. Access is blocked at expiry even if background physical deletion is still pending; failed cloud deletions are retried. An expiry response alone does not confirm that every stored byte has already been deleted.

What to do next

  1. 01

    Validate before persistence

    Require a completed job and successful expected content response. Stream bytes through a bounded backend process rather than loading large base64 data into analytics or a public browser bundle.

  2. 02

    Store under an owned object key

    Use your application's tenant and task association, not a raw user-supplied path. Save MIME type, size and checksum where useful, keeping the storage bucket private by default.

  3. 03

    Deliver with your authorization

    Check the requesting user before serving or signing access to your copy. Explain your retention and deletion behavior separately from the provider's private result route.

A concrete example

Illustrative pipeline: a completed MP4 is downloaded server-side, validated, checksummed and stored under an internal tenant/task path. The customer receives access controlled by your app rather than a permanent public bucket URL or an account secret.

Before you call it ready

  • Only validated completed content is copied.
  • Storage ownership follows the application user.
  • Retention covers both original and copied assets.

When to stop or choose another method

If your product cannot manage the privacy and retention of an extra copy, avoid creating it automatically. A convenient cache should not silently become an unmanaged media archive.

Sources

One task. A recoverable workflow.

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

Open API documentation