Create an upload
Creates an upload slot and answers 201 with a signed upload_url. PUT the file there with every header in
upload_headers within 15 minutes, then use asset_id as image, image_2 or image_3 in an edit. TensorFactory
doesn't keep uploads: one is deleted when the run that uses it ends, or 30 minutes after it is made if no run uses
it. Upload the file again for each edit.
apiKeyAuthorizationBearer <tf_...>Your API key from API keys, sent as Authorization: Bearer $TENSORFACTORY_API_KEY. Keep it on your server.
application/json- body
kind?"image"Optional. Always image.
"image"mime*stringThe file's type.
"image/jpeg""image/png""image/webp"bytes*integerThe file's size in bytes, up to 7 MiB.
1 <= value <= 7340032filename?stringOptional.
length <= 200The upload slot.
application/json- response
asset_id*stringSend it as image, image_2, image_3 or mask.
uuidupload_url*stringWhere to PUT the file. Signed. No key needed.
uriupload_headers*Send each of these headers with the PUT.
expires_at*stringWhen upload_url stops working (15 minutes).
date-timecurl -X POST 'https://tensorfactory.ai/v1/uploads' \ -H 'Content-Type: application/json' \ -d '{ "kind": "image", "mime": "image/jpeg", "bytes": 482113, "filename": "photo.jpg"}'{ "asset_id": "6f1d2c3b-8a4e-4f0b-9d6a-1c2e3f4a5b6c", "upload_url": "https://tensorfactory.ai/v1/uploads/6f1d2c3b-8a4e-4f0b-9d6a-1c2e3f4a5b6c/data?expires=1794046504&signature=...", "upload_headers": { "Content-Type": "image/jpeg" }, "expires_at": "2026-11-07T10:15:04.000Z"}Cancel a generation POST
Stops a queued or running generation. It ends `cancelled` and costs nothing. A generation that is already over is answered as it is.
Send the file PUT
Sends the file's bytes to the `upload_url` from `POST /v1/uploads`, with every header in `upload_headers`. The link is signed: it needs no key and works for 15 minutes. The type is checked by the file's first bytes (JPEG, PNG or WebP). Each slot takes one file.