spicyapiDocs
Main content

Media

Presigned direct uploads for reference media, and short-lived download links for artefacts.

Many models take a picture, video or sound clip as input (a reference), and a media model gives you a file back (an artefact). This page covers both directions:

  • Reference inputs — pass a public HTTPS URL, a small image written straight into the request, or a file you upload. To upload, request an upload ticket, PUT the file straight into object storage, then commit it; the commit returns a spicy:// URI that you put in the task input.
  • Artefact downloads — fetch the signed output.assets[].url returned with the result. Not every model produces a file: an endpoint whose result is text answers in output.text and has no assets at all, with nothing to download and no link to expire. See The shape of output.

Upload tickets and artefact downloads live under /api/v1/common/; upload commits use /api/v1/files/{fileId}/commit. Uploading is free; you pay only for the task that uses the file.

Existing HTTPS media

Pass a publicly accessible HTTPS image, video, or audio URL directly in the model-supported field (for example, image_url). No platform upload or spicy:// conversion is required. The URL must remain reachable without custom authorization headers while the task runs. Larger local files use the upload flow below.

The URL must return the file itself. A share-page link (a cloud drive, a photo album, a social post) returns a web page rather than the image, and the task fails with invalid_asset. In that case, download the file and upload it instead.

Base64 and local files

Small images can be passed directly in schema-declared image fields, for example image_url: "data:image/png;base64,...". Include the MIME type and use standard Base64. Bare Base64, URL-safe encoding, whitespace, SVG, and inline audio or video are not supported by this path.

  • JPEG, PNG, WebP and GIF: at most 1 MiB decoded per image, 8192 pixels per side, and 8,388,608 pixels per image.
  • At most 16 images and 16,777,216 combined pixels per request. The entire JSON body must fit within 2 MiB, including Base64's roughly one-third size overhead.
  • Model-specific schema and media limits still apply. Quotes validate without uploading or reserving funds. Creation stores the images as account-bound uploads, which last one day like any other upload; task input contains file URIs instead of echoing Base64 bytes.

For larger files, the SDK handles the ticket, PUT and commit:

import { SpicyClient } from '@spicyapi/sdk';

const client = new SpicyClient();
const file = await client.uploadFile('./reference.png');
// With existing Base64, use uploadBase64(dataUri),
// or uploadBase64(rawBase64, { contentType: 'image/png' }).
console.log(file.uri);

uploadBase64 is a file-upload helper that goes through the same upload API and its limits below. The small-inline-image 1 MiB limit does not apply to this helper; individual models must still support the selected media type. Existing public HTTPS media needs no upload helper.

1. Direct reference upload

For a local reference file that is not already hosted at a public HTTPS URL, uploading takes four steps. The curl commands below are meant to be run one after another in the same terminal window (macOS or Linux, with jq installed): each step saves what the next one needs in a shell variable. On Windows, use the SDK or the Python example at the end of this section.

Request a ticket

POST /api/v1/common/upload-url

Prop

Type

There is no filename field, and that is deliberate

Object keys are always generated server-side. Letting the caller pick a path would let anyone mint an upload URL pointing at someone else's object and overwrite it.

Upload limits

contentTypeExtensionLargest fileLongest duration
image/jpeg.jpg10 MiB—
image/png.png10 MiB—
image/webp.webp10 MiB—
image/gif.gif10 MiB—
audio/wav.wav90 MiB600 seconds
audio/mpeg.mp390 MiB600 seconds
video/webm.webm90 MiB600 seconds
video/mp4.mp490 MiB600 seconds
video/quicktime.mov90 MiB600 seconds
model/gltf-binary.glb (3D mesh)90 MiB—
model/x-fbx.fbx (binary 3D mesh)90 MiB—
model/obj.obj (3D mesh)90 MiB—
model/stl.stl (3D mesh)90 MiB—
application/octet-stream.safetensors (LoRA weights)2 GiB—

.mov (what an iPhone camera records by default) is accepted and converted to MP4 on the way in, so what the model receives is always MP4. It is accepted by the web uploader and by the upload API; the CLI, SDK and MCP server infer the type from the extension and do not yet list it, so pass contentType: video/quicktime explicitly there.

3D models for retexture, rig, animate and convert endpoints (mesh_url) are uploaded as model/gltf-binary (.glb), model/x-fbx (binary .fbx), model/obj (.obj) or model/stl (.stl), up to 90 MiB. Commit verifies the file header (and checks that .glb files are complete). The JSON form of glTF (.gltf) is not accepted because it references external binary and texture files — export it as .glb instead. Uploaded 3D meshes can be used only in mesh input fields.

LoRA weights are uploaded as application/octet-stream: a .safetensors file up to 2 GiB (the web uploader takes up to 90 MiB). The ticket stays valid for two hours instead of 20 minutes, and commit checks that the file is a complete safetensors file. Put the returned URI in loras[].path; a weights file cannot be used in any other field. A file that needs a sign-in to download, such as one in a private Hugging Face repository, can be imported from its link instead: see Adapter weights.

A model can accept less: respect its schema's x-ui.max_size_mb, and treat the ticket's maxBytes as the authoritative ceiling for this upload.

curl
FILE=reference.png            # the file to upload
CONTENT_TYPE=image/png        # must match the file type in the table above
BYTES=$(wc -c < "$FILE" | tr -d ' ')

TICKET=$(curl -s -X POST https://api.spicyapi.ai/api/v1/common/upload-url \
  -H "Authorization: Bearer $SPICY_API_KEY" \
  -H "Content-Type: application/json" \
  --data "$(jq -n --arg type "$CONTENT_TYPE" --argjson bytes "$BYTES" '{contentType: $type, bytes: $bytes}')")
echo "$TICKET" | jq .

UPLOAD_URL=$(echo "$TICKET" | jq -r .data.uploadUrl)
FILE_ID=$(echo "$TICKET" | jq -r .data.fileId)

You should see a response like this, and UPLOAD_URL and FILE_ID now hold its uploadUrl and fileId:

{
  "code": 200,
  "msg": "success",
  "data": {
    "fileId": "fil_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "key": "spicy://f/fil_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "uploadUrl": "https://<account-id>.r2.cloudflarestorage.com/spicy-production-inputs/tmp/…?X-Amz-Signature=…",
    "method": "PUT",
    "headers": {
      "Content-Type": "image/png",
      "Content-Length": "402118"
    },
    "expiresAt": "2026-08-28T09:32:11Z",
    "maxBytes": 10485760
  }
}

expiresAt is about 20 minutes away. Both the PUT and the commit must finish before then; after that, commit returns 409 and you need a new ticket. Request the ticket right before you upload, not in advance.

PUT the file

PUT the bytes to uploadUrl. Non-browser clients such as curl, Node.js and Python should send every header from headers exactly as given. Browser clients must handle Content-Length as described below.

Drop one header and the signature no longer matches

Both Content-Type and Content-Length are signed. Change a byte of either and object storage rejects the upload — with a 403 that comes from the storage layer rather than from us, which makes it look baffling.

Browsers define Content-Length as a forbidden request header, so application code cannot set it through either fetch or XMLHttpRequest. In a browser, send a File or Blob whose size exactly matches the ticket's bytes and let the user agent generate Content-Length from the body; set only the other ticket headers yourself. The response still lists Content-Length for non-browser clients and so browser code can verify the file size before sending it.

Do not send an Authorization header on this request. The presigned URL is the credential; an extra auth header makes some storage implementations reject it.

curl
# Prints only the HTTP status. Expect 200.
curl -s -o /dev/null -w "%{http_code}\n" -X PUT "$UPLOAD_URL" \
  -H "Content-Type: $CONTENT_TYPE" \
  -H "Content-Length: $BYTES" \
  --data-binary @"$FILE"
Browser
const uploadHeaders = new Headers(ticket.data.headers);
uploadHeaders.delete('Content-Length'); // the browser derives it from File/Blob

if (file.size !== Number(ticket.data.headers['Content-Length'])) {
  throw new Error('file size does not match the upload ticket');
}

await fetch(ticket.data.uploadUrl, {
  method: ticket.data.method,
  headers: uploadHeaders,
  body: file, // File or Blob; do not turn it into text, Base64 or FormData
});

Commit the upload

A successful PUT only means that a temporary object was written. Continue with the fileId from step one:

curl
curl -s -X POST "https://api.spicyapi.ai/api/v1/files/$FILE_ID/commit" \
  -H "Authorization: Bearer $SPICY_API_KEY" | jq .

Expect "status": "ready" and a uri that starts with spicy://:

{
  "code": 200,
  "msg": "success",
  "data": {
    "fileId": "fil_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "status": "ready",
    "bytes": 402118,
    "contentType": "image/png",
    "sha256": "a91f4c2e5b7d16809e3f2a4c8d0b61e7c4a890e5d2f71b3c609ae8427d15f0c6",
    "uri": "spicy://f/fil_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "expiresAt": "2026-08-29T09:12:11Z"
  },
  "request_id": "req_01k3m8x9q2z4v7n5p6r8s0t1w2"
}

Commit compares the stored size and media type with the ticket, checks the media signature, computes SHA-256, and copies the bytes to a private object that the old ticket cannot overwrite. For audio and video it may also return durationSeconds as a decimal string, plus numeric width and height. Repeating a successful commit is idempotent.

ResponseMeaningFix
400, code: 40003The stored file's size, type or format does not match what you declaredRequest a new ticket with the correct contentType and exact bytes, then upload again
400The file is not there yet: the PUT did not finish or failedCheck that the PUT returned 200, then commit again
404No such fileId on this accountUse the fileId from your own ticket
409The ticket or the uploaded file has expired, or an earlier commit rejected this fileStart over from step 1
409 / 429Verification of this file is already running, or the verifier is busyWait a second and commit again

A PUT must be followed by commit

An uncommitted file cannot be used to create a task. Do not use the ticket's temporary storage path, and do not use the compatibility key field until commit succeeds.

Put the spicy:// URI in your input

Use only data.uri from the commit response — not uploadUrl, a temporary object key, or the bare fileId — as the reference field.

Which field takes a file depends on the model. In the model's inputSchema, a field that takes a file has x-ui.widget set to upload (one file) or multi-upload (a list — put the URI inside an array). x-ui.accept lists the file types and x-ui.max_size_mb the size that model accepts. See Model catalog and schemas.

MODEL_ID_FROM_CATALOG and the remaining input fields below are structural placeholders; select the exact model and schema-valid input from the same authenticated live catalog item. The task is decided by model itself, so input carries no endpoint field; it accepts only the fields listed in that model's inputSchema, and one extra field returns 400:

{
  "model": "MODEL_ID_FROM_CATALOG",
  "input": {
    "prompt": "slow dolly in, rain on the window",
    "image_url": "spicy://f/fil_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "duration_seconds": 5
  }
}

The platform resolves a committed spicy:// URI when the task runs. This allows uploaded files to remain usable while a task is queued without requiring you to manage temporary download URLs. Use the URI returned by commit unchanged.

A URI that is not ready, is expired, or belongs to another account is rejected at creation with 400.

Full example

JavaScript
import { readFile } from 'node:fs/promises';

const BASE = 'https://api.spicyapi.ai/api/v1';
const AUTH = { Authorization: `Bearer ${process.env.SPICY_API_KEY}` };

async function uploadReference(path, contentType) {
  const file = await readFile(path);

  // 1. Get a ticket
  const ticketRes = await fetch(`${BASE}/common/upload-url`, {
    method: 'POST',
    headers: { ...AUTH, 'Content-Type': 'application/json' },
    body: JSON.stringify({ contentType, bytes: file.byteLength }),
  });
  const ticket = await ticketRes.json();
  if (ticket.code !== 200) throw new Error(`${ticket.code} ${ticket.msg}`);

  // 2. Upload directly. No Authorization here; pass the headers through as-is
  const put = await fetch(ticket.data.uploadUrl, {
    method: ticket.data.method,
    headers: ticket.data.headers,
    body: file,
  });
  if (!put.ok) throw new Error(`upload failed: ${put.status}`);

  // 3. Commit so the server verifies and freezes the uploaded bytes
  const commitRes = await fetch(
    `${BASE}/files/${encodeURIComponent(ticket.data.fileId)}/commit`,
    { method: 'POST', headers: AUTH },
  );
  const committed = await commitRes.json();
  if (committed.code !== 200) throw new Error(`${committed.code} ${committed.msg}`);

  // 4. Task input uses only the spicy:// URI returned by commit
  return committed.data.uri;
}

console.log(await uploadReference('./reference.png', 'image/png'));
Python
import os, requests

BASE = "https://api.spicyapi.ai/api/v1"
AUTH = {"Authorization": f"Bearer {os.environ['SPICY_API_KEY']}"}


def upload_reference(path: str, content_type: str) -> str:
    with open(path, "rb") as f:
        data = f.read()

    # 1. Get a ticket
    ticket = requests.post(
        f"{BASE}/common/upload-url",
        headers={**AUTH, "Content-Type": "application/json"},
        json={"contentType": content_type, "bytes": len(data)},
    ).json()
    if ticket["code"] != 200:
        raise RuntimeError(f'{ticket["code"]} {ticket["msg"]}')

    # 2. Upload directly. No Authorization; pass the headers through as-is
    put = requests.put(ticket["data"]["uploadUrl"], headers=ticket["data"]["headers"], data=data)
    put.raise_for_status()

    # 3. Commit so the server verifies and freezes the uploaded bytes
    committed = requests.post(
        f'{BASE}/files/{ticket["data"]["fileId"]}/commit',
        headers=AUTH,
    ).json()
    if committed["code"] != 200:
        raise RuntimeError(f'{committed["code"]} {committed["msg"]}')

    # 4. Task input uses only the spicy:// URI returned by commit
    return committed["data"]["uri"]


print(upload_reference("reference.png", "image/png"))

An extra rate limit

On top of the general open-API budget, upload-url has its own 1,000 requests per 10 seconds high-level fuse against abusive or runaway object-storage write authorization.

The cost here is asymmetric: signing a ticket is pure local computation for us, but each ticket is a write authorisation that no longer passes through us. A human picking files cannot go that fast, and a batch script uploading a few dozen references still fits comfortably.

2. Download results

Ready results already include output.assets[].url and expiresAt in polling and v2 callbacks. Fetch that URL directly without an API key; download-url below is optional. Links normally last 20 minutes, and never outlast that task's retention window — capped at about 14 days, shorter if you set it so.

To keep a result, save it to your own storage while the link is valid. For example:

curl -L -o result.png "PASTE_THE_OUTPUT_URL_HERE"

Do not add an Authorization header to this request. If the link has expired (storage answers 403), query the task again with recordInfo to get a fresh one.

Optional download-link refresh

POST /api/v1/common/download-url

Prop

Type

curl
curl -X POST https://api.spicyapi.ai/api/v1/common/download-url \
  -H "Authorization: Bearer $SPICY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskId": "job_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "key": "tasks/2026/08/28/job_01k3m8x9q2z4v7n5p6r8s0t1w3/9f3c1d0a7b4e2f68c5a1d3e9b0472fa1.png",
    "download": true
  }'
{
  "code": 200,
  "msg": "success",
  "data": {
    "key": "tasks/2026/08/28/job_01k3m8x9q2z4v7n5p6r8s0t1w3/9f3c1d0a7b4e2f68c5a1d3e9b0472fa1.png",
    "url": "https://<account-id>.r2.cloudflarestorage.com/spicy-production-results/tasks/…?response-content-disposition=attachment%3B%20filename%3D…&X-Amz-Signature=…",
    "filename": "image-model-01k3m8x9q2z4-1.png",
    "expiresAt": "2026-08-28T09:32:11Z"
  }
}

Passing "download": true in the JSON body (or ?download=1 on the URL, such as POST /api/v1/common/download-url?download=1) bakes Content-Disposition: attachment with a sanitized, model-named filename (<model>-<short-task-id>-<index>.<ext>) and Cache-Control: no-store into the signed object-storage URL. Because browsers ignore the HTML download attribute on cross-origin links, use attachment mode whenever you hand the URL directly to a browser "Download" button. When download is omitted or false, the link opens inline and data.filename is omitted.

For a task with several artefacts, call once per key. Like recordInfo, this works only with the API key that created the task.

A signed URL is a self-attesting string: object storage will not ask again who is holding it. Therefore

  • Do not store it in your database, and do not put it in a long-lived cache you serve to browsers. Sign one when you need it — signing is local computation and effectively free.
  • Download anything you want to keep. Artefacts live about 14 days on our side at most, and less if you shorten the clock; see Retention and destruction.
SituationWhat you seeWhat to do
Still being copied into our storageThe asset shows pending: true in recordInfo; download-url without key returns 409 (with an explicit key it returns 404 until the copy is done)Wait a few seconds and query again
The copy failed for goodThe asset shows unavailable: true and has no keyWaiting will not help — regenerate
Task has not succeeded yet404, "This task has no downloadable output"Wait for state: "succeeded"
Past its retention period, or you destroyed itHTTP 410 with code: 404, "This output has expired or was deleted"Gone for good — regenerate

A task that is not yours, or a key that does not belong to the task, both return 404. We do not distinguish "does not exist" from "belongs to someone else", because that difference can be used to enumerate other people's task IDs.

Asset library

Some files you use again and again: a character portrait, a style reference, a product shot, a voice sample. The asset library keeps them for you until you delete them and gives each one a stable reference, spicy://a/<id>. Put that reference in any media field of any task input, the same way you use a spicy://f/ upload, only without the one-day expiry.

  • Private to your workspace. A spicy://a/ reference works only in requests made with keys of the same workspace. A personal key reaches your personal library; a key created in a team workspace reaches that team's shared library, and the two never connect (see below).
  • Kept until it is deleted. Generated results are cleaned up after about 14 days and uploads after 1 day; saved assets stay until you delete them. A personal library goes when you close your account, and a team library goes with its team.
  • Not file hosting. The API gives you the spicy://a/<id> reference and a previewUrl signed for you alone, valid for at most 20 minutes. There is no public or permanent link, and a reference cannot be turned into one. Store uri, never previewUrl.

Personal and team libraries

The key decides the library. A key created in your personal workspace reaches your personal library. A key created in a team workspace, by any member, reaches that team's shared library. A team key never reaches anyone's personal library, a personal key never reaches a team library, and a spicy://a/ reference from the other library is rejected as if it did not exist.

What a team key may change follows the current role of the member who created it:

RoleSaveRename or deleteList, read and use
owner, adminYesAny assetYes
developerYesOnly assets they savedYes
billing, readonlyNoNoYes

If that member has left the team, the key gets 403 with data.reason asset_workspace_forbidden. Assets are not labelled with who saved them; you only see whether you may change one.

Save a file

POST /api/v1/assets copies a file into your library. The Idempotency-Key header is required. Choose one of three sources:

sourceFieldsNotes
task_outputtaskId, and key or indexOne of your own successful tasks. index counts from 0 in the order of output.assets in recordInfo.
uploadfileIdA committed upload: fil_… or spicy://f/fil_….
urlurlA public http or https address on port 80 or 443, without a username or password. The file is downloaded once and its type is read from the file itself; only images, video and audio are accepted.

name is optional (up to 80 characters; default Saved asset). Saving the same source again returns the asset you already have and uses no extra space. Size, dimensions and duration are measured by us.

curl
curl -X POST https://api.spicyapi.ai/api/v1/assets \
  -H "Authorization: Bearer $SPICY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "task_output",
    "taskId": "job_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "index": 0,
    "name": "Hero portrait"
  }'
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": "ast_01k3m9c4w8r2n6t5v1x7y0z3ab",
    "uri": "spicy://a/ast_01k3m9c4w8r2n6t5v1x7y0z3ab",
    "name": "Hero portrait",
    "kind": "image",
    "contentType": "image/png",
    "bytes": 1843201,
    "width": 1536,
    "height": 1024,
    "source": "task_output",
    "sourceId": "job_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "createdAt": "2026-10-11T08:20:11Z",
    "updatedAt": "2026-10-11T08:20:11Z",
    "previewUrl": "https://…",
    "previewUrlExpiresAt": "2026-10-11T08:40:11Z"
  }
}

Use it in a task

Put data.uri in any file field the model's inputSchema marks with x-ui.widget upload or multi-upload:

{
  "model": "MODEL_ID_FROM_CATALOG",
  "input": {
    "prompt": "slow dolly in, rain on the window",
    "image_url": "spicy://a/ast_01k3m9c4w8r2n6t5v1x7y0z3ab",
    "duration_seconds": 5
  }
}

A reference that has been deleted, or that sits in a library this key does not reach (another account's, or the other workspace's), is rejected when the task is created, exactly like an unknown ID.

List, rename and delete

GET /api/v1/assets returns your assets as items plus a nextCursor that is absent on the last page. Filter with kind (image, video or audio), source (comma-separated: task_output,upload,url), q (a case-insensitive search in the name), favorite (true for favorites only, false for everything else) and collectionId (one folder, see below). Order with sort: recent (default, newest first), oldest, name (A to Z, case-insensitive) or size (largest first). limit is 1 to 100 and defaults to 100. Pass the previous nextCursor as cursor to continue; a cursor only works with the sort it came from, and one from another sort is rejected with 400.

curl
curl "https://api.spicyapi.ai/api/v1/assets?kind=image&q=portrait&sort=name&limit=20" \
  -H "Authorization: Bearer $SPICY_API_KEY"

curl -X PATCH https://api.spicyapi.ai/api/v1/assets/ast_01k3m9c4w8r2n6t5v1x7y0z3ab \
  -H "Authorization: Bearer $SPICY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Hero portrait v2"}'

curl -X DELETE https://api.spicyapi.ai/api/v1/assets/ast_01k3m9c4w8r2n6t5v1x7y0z3ab \
  -H "Authorization: Bearer $SPICY_API_KEY"

GET /api/v1/assets/{id} returns one asset with a fresh previewUrl. PATCH changes the name, the favorite flag or both (send only what you want to change); the uri stays the same. DELETE makes the asset disappear at once and its uri stops working in new requests. Both are safe to repeat and need no Idempotency-Key. An unknown asset and another account's asset return the same 404.

Favorites, folders and the generating model

Every asset has a favorite flag. Set it with PATCH and {"favorite": true}. In a team library the mark belongs to the library, so everyone sees the same favorites. Folders (called collections in the API) group assets without copying them, and one asset can sit in several folders. You create and manage folders on the Assets page of the web app; the API cannot create or edit them, but collectionId on GET /api/v1/assets lists the assets of one folder (404 when that folder is not in the library your key reaches).

Every asset also carries model, the public name of the model that generated it, and modelName, its display name. Both are empty strings for uploads and links.

Characters

A character is a name plus an ordered set of image assets from the same library: up to 100 images and an optional note of up to 280 characters. The images are the assets themselves and nothing is copied. Deleting a character keeps its images, and deleting an image removes it from every character. You create and edit characters on the Assets page of the web app or in Studio. They need no storage of their own: only your library plan counts.

The API only reads characters:

  • GET /api/v1/assets/entities lists them, newest first. assetId keeps only the characters that contain that asset, limit is 1 to 100 (default 50), and cursor continues from the previous nextCursor.
  • GET /api/v1/assets/entities/{id} returns one character. An unknown character, another account's and one in a library your key does not reach all return the same 404.

Each character has id, kind (always character), name, note, cover (the cover image as an asset, or null while it has no images), assets (the images in order, each with its uri and a private previewUrl), count, createdAt and updatedAt. The key decides the library exactly as for assets, and reading characters shares the limit of 60 requests per minute with reading assets.

To use a character, put its images, in that order, as spicy://a/ references into the model's reference-image field, and refer to them in the prompt the way that model's page describes. Characters used to be called personas and lived in a separate library; they are now part of the asset library. Existing spicy://p/ references keep working, in your personal library only.

When you add an image you uploaded yourself (rather than a generated result) to a character, you confirm that you own the rights to it and, if it shows a real person, that you have that person's consent.

Storage plans

Storage unlocks automatically with your lifetime top-ups and only ever goes up; a change in the table never deletes assets you have already saved. GET /api/v1/assets/usage is the source of truth for your account: your plan, what you have stored, the limits, the next plan and how much more to top up to reach it, and how many assets you created today. The table shows the current defaults.

Storage belongs to the owner: the owner's lifetime top-ups decide the plan, and the owner's personal library and every team library they own share one allowance. usage covers that whole allowance and carries a scope object (workspaceId, personal, role, canWrite, canTopUp) saying which library your key reaches and what it may do there. When canTopUp is false (a team key not created by the team owner), lifetimeTopupUsd and topupToNextTierUsd are left out, and a full library asks you to contact the team owner instead of naming an amount.

PlanLifetime top-upsStorageItemsPer file
Freenonenone: nothing new can be saved0n/a
Plus$10 or more500 MB200100 MB
Pro$100 or more1 GB400100 MB
Studio$250 or more2 GB800100 MB
Max$1,000 or more10 GB4,000100 MB

Without a top-up you cannot save anything new, but assets you already saved stay usable. The 100 MB per-file limit applies to task outputs and links. A file that comes in through upload is still bound by the upload limits themselves (images 10 MiB, audio and video 90 MiB).

Rate limits and errors

  • Reading (list, get, usage): 60 requests per minute. Saving: 30 requests per minute, and 200 new assets per UTC day. Deleting an asset does not give the daily allowance back. When a limit is hit you get 429 with a Retry-After header.
  • A library that is full, storage that is not unlocked yet, or a file above your per-file limit returns 400 with invalid_request. The message names your current plan and how much you need to top up to unlock the next one.
  • 403 with data.reason asset_workspace_forbidden when the key cannot reach the library, or asset_permission_denied when your team role does not allow the change. 503 when platform storage is temporarily full; retry later.

A failure on these endpoints can carry a machine-readable data.reason: asset_library_locked, asset_library_full, asset_file_too_large, asset_daily_limit, asset_storage_full, asset_permission_denied, asset_workspace_forbidden or asset_entity_name_taken. code, the HTTP status and errorCode do not change with or without it, and the reason appears only on the asset library endpoints; the OpenAI-compatible and other compatibility layers keep their own error shapes. Unknown values should be treated like an absent reason. See Asset library reason codes.

The web app also has an auto-save switch for the library. It applies only to generations you start in the web app; generations started through the API are never saved automatically, so call POST /api/v1/assets for the ones you want to keep.

Retention of uploads

An uploaded reference URI is retained for 1 day from a successful commit — a platform cap you can shorten, or replace with destroy-on-completion, on Retention and destruction — and can be used only until the expiresAt returned by that commit. The URI becomes unusable at expiry, including for a retry of a task that referenced it. Object-storage lifecycle deletion can then lag by up to 24 hours, but that cleanup window does not extend the URI's usable lifetime. If you need the same reference again, keep your own copy and upload it again.

On this page