Skip to content

Can I rotate an API key without regenerating existing jobs?

Key rotation does not require recreating completed or pending generation tasks. Preserve their job IDs and use a valid replacement key from the same account with the relevant model scope. AISwapLab checks account ownership and model permission for job access. Revoking a credential is an authentication change, not a request to cancel or regenerate paid work.

PROTECT KEYS AND ACCOUNT ACCESSAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Inventory outstanding work; Deploy a scoped replacement; Retire and observe.
Workflow diagram: Inventory outstanding work → Deploy a scoped replacement → Retire and observe. Read the article for evidence and limits.

Rotate credentials and task identities independently

The original key identifies how the job was submitted, while the account owns the resource. Your application should therefore retain durable task records outside the secret configuration. Changing a server environment value must not clear the user-to-job mapping or generate new idempotency identifiers for work already accepted.

What to do next

  1. 01

    Inventory outstanding work

    Record accepted task IDs, model aliases and current states before changing configuration. Include uncertain jobs rather than dropping them from the list because they lack a playable file.

  2. 02

    Deploy a scoped replacement

    Create and privately configure the new key with the model permissions needed to read those jobs. Test authenticated retrieval of an existing owned job without posting another generation.

  3. 03

    Retire and observe

    Revoke the old credential when its intended consumers have migrated. Watch for 401 failures from forgotten workers, and update those workers rather than resubmitting their tasks.

A concrete example

Illustrative rotation: a completed H3 task remains in the application's database after the original credential is revoked. A same-account H3-scoped replacement downloads it by its existing job ID; no additional video is requested.

Before you call it ready

  • Existing task records survive rotation.
  • Replacement scope includes the old jobs' models.
  • Revocation is not presented as cancellation.

When to stop or choose another method

If the replacement belongs to another account, do not expect ownership access to transfer. Restore the correct account configuration rather than copying private resources through unauthorized credentials.

Sources

One task. A recoverable workflow.

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

Open API documentation