Skip to content

Why do I receive a job instead of b64_json from the image endpoint?

AISwapLab returns a durable image job to the customer, even when its upstream gateway supplied base64 image data. Poll the job and fetch the authenticated content_url after completion. Do not expect data[0].b64_json in the initial response or add response_format hoping to change the public asynchronous contract.

GENERATE AND INSPECT API IMAGESAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Inspect the first response; Wait for completion; Download the owned content.
Workflow diagram: Inspect the first response → Wait for completion → Download the owned content. Read the article for evidence and limits.

The gateway handles upstream output retrieval

The service can receive image bytes, validate dimensions, remove metadata and save the private asset before delivery. Your application should handle the documented job shape and private download rather than depending on a provider's internal encoding. This also avoids copying large base64 strings into browser logs or application task records.

What to do next

  1. 01

    Inspect the first response

    Read its id, kind, status and poll_url. Store those values with the user's approved request instead of searching for an immediate image data array.

  2. 02

    Wait for completion

    Use bounded status checks and retain unknown or saving states. A 2xx creation response is not enough to draw an image that has not been delivered.

  3. 03

    Download the owned content

    Request the returned content route with the server-side key, check its MIME type and save or stream the actual bytes to the authorized user.

A concrete example

Illustrative integration error: a client calls atob on an undefined b64_json property and reports that generation failed. The remote image may still be processing; updating the client to the job lifecycle recovers the intended flow without another paid request.

Before you call it ready

  • The customer response shape drives parsing.
  • Provider encoding is not assumed to leak through.
  • Large media is not logged as JSON.

When to stop or choose another method

If a third-party component only accepts immediate base64 results, add a backend adapter after private download. Do not misrepresent the creation endpoint as synchronous.

Sources

One task. A recoverable workflow.

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

Open API documentation