Skip to content

Why does a valid key still fail to read an existing job or download?

A valid credential is necessary but not sufficient. The job must belong to the same AISwapLab account, and the key must allow that job's model. The content route also requires a completed task with a stored result. Do not treat every 403, 404 or not-ready response as a corrupted file or expired media link.

PROTECT KEYS AND ACCOUNT ACCESSAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Identify the resource; Inspect permission and status; Keep delivery private.
Workflow diagram: Identify the resource → Inspect permission and status → Keep delivery private. Read the article for evidence and limits.

Authorization applies again at retrieval

Private results are not public URLs that anyone can fetch after learning a job ID. A replacement key with the wrong account or missing model scope cannot read the resource. Your own backend must also check which of its users owns the internal task before using an account-wide credential to retrieve it.

What to do next

  1. 01

    Identify the resource

    Compare the requested job ID with the durable creation response and the account that submitted it. Avoid copying a placeholder ID from a tutorial or another environment.

  2. 02

    Inspect permission and status

    Check the key's allowed model and poll the existing job. Only use /content after completed; a running or unknown task does not yet authorize a ready-file assumption.

  3. 03

    Keep delivery private

    Send the bearer credential from the backend and validate the returned status and MIME type. Do not turn a permission error body into a file named result.mp4.

A concrete example

Illustrative diagnosis: a newly rotated image-only key receives a permission error while fetching an older H3 job. The remedy is a same-account key with H3 scope, not a new video generation or a public bucket setting.

Before you call it ready

  • The resource belongs to the authenticating account.
  • The job's model is allowed by the key.
  • The task is complete before content retrieval.

When to stop or choose another method

If ownership does not match, stop and correct the account or internal routing. Do not weaken storage privacy to make an unauthorized download succeed.

Sources

One task. A recoverable workflow.

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

Open API documentation