API reference
Call open models with one REST API.
TensorFactory makes images from a prompt and edits photos with one sentence. JSON in and out, called with your API key.
- Base URL:
https://tensorfactory.ai/v1 - Times are ISO 8601 in UTC.
- The API sends no CORS headers: call it from your server and keep your key out of browser code.
- Every error has the same shape (see the
Errorschema and the Errors page).
Start with the quickstart or the guides to generate and edit an image.
Endpoints
Get your limits
GET /v1/limits
Create a generation
POST /v1/generations
List generations
GET /v1/generations
Get a generation
GET /v1/generations/{id}
Delete a generation
DELETE /v1/generations/{id}
Cancel a generation
POST /v1/generations/{id}/cancel
Create an upload
POST /v1/uploads
Send the file
PUT /v1/uploads/{asset_id}/data
Get an upload
GET /v1/uploads/{asset_id}
Delete an end user's data
DELETE /v1/end-users/{end_user}
List models
GET /v1/models
Download an image
GET /v1/files/outputs/{file}
Overview
Every endpoint, field and error of the TensorFactory API.
Create a generation POST
Starts an image and answers `202` with the generation, usually `status: "queued"`. Then get it with `GET /v1/generations/{id}?wait=10` until it is over. Send a new `Idempotency-Key` for each new image and the same key when you retry the same request: a retry answers with the generation the first request made. Fields not listed here are refused with `400`. A prompt that names a real, identifiable person is still accepted, then the run ends `failed` with `real_person`, charged nothing. When no GPU worker has room (the first image after a quiet spell, or every running worker's line full), the run is still accepted: it stays `queued`, oldest first, until a worker can take it (a fresh worker takes several minutes to start) and then runs. One that gets no worker within 20 minutes ends `failed` with `timed_out`, charged nothing. `503 unavailable` means the run couldn't be handed to a GPU worker at all. Nothing is charged, so retry with the same `Idempotency-Key`. The line has no length limit.