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.
{
"availability": "available",
"assets": [
{
"id": "file_7m2qk4zt6wbx3rn5yd2hc4vlaq",
"type": "video",
"mime_type": "video/mp4",
"url": "https://s3.astorie.ai/req/7a1e0c55/0.mp4"
}
]
}Asset fields
| Field | Meaning |
|---|---|
id | Stable ID of this asset within the job. |
type | image or video today. More types may be added. |
mime_type | For example image/png or video/mp4. |
url | Where to download it. |
width | Pixel 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:
| availability | Meaning |
|---|---|
not_ready | No result: the job hasn't finished, or it ended without one (failed or canceled). |
available | You can download the assets. |
expired | Reserved for when results expire. Not sent today. |
deleted | Reserved for when results are deleted. Not sent today. |