Core concepts

Results

Download a finished job's files and how long they are kept.

When a job succeeds, its files are listed in output.assets.

output
{
  "availability": "available",
  "assets": [
    {
      "id": "file_7m2qk4zt6wbx3rn5yd2hc4vlaq",
      "type": "video",
      "mime_type": "video/mp4",
      "url": "https://s3.astorie.ai/req/7a1e0c55/0.mp4"
    }
  ]
}

Asset fields

FieldMeaning
idStable ID of this asset within the job.
typeimage or video today. More types may be added.
mime_typeFor example image/png or video/mp4.
urlWhere to download it.
widthPixel size, when known.

Downloading

Result URLs don't need an API key. Don't send your key to them. Anyone with the URL can download the file, so treat URLs as private and keep them out of logs.

import { Astorie } from "@astorie/client";

const client = new Astorie();

import { writeFile } from "node:fs/promises";

const job = await client.getJob("job_3k7qz2m5x4rbd6wn2yhv7tcl4a");
const bytes = await client.downloadAsset(job.output.assets[0]);
await writeFile("result.png", bytes);

How long results are kept

Results are kept for at least 7 days. Download anything you want to keep and store it yourself. output.availability tells you where things stand:

availabilityMeaning
not_readyNo result: the job hasn't finished, or it ended without one (failed or canceled).
availableYou can download the assets.
expiredReserved for when results expire. Not sent today.
deletedReserved for when results are deleted. Not sent today.