Authentication
Usehttps://api.reactor.inc as the base URL. Send Authorization: Bearer rk_... on every API
request and Content-Type: application/json for JSON bodies. Keep your key on your server.
The key’s account must have access to the model you want to run.
POST /files accepts API keys only, not short-lived session tokens. Do not send your API key to
signed upload or download URLs.
Upload files
Create a file: POST /files
Send exactly these three fields:
Returns
201 Created:
expires_at is the deadline for using the file in a generation: normally 24 hours after creation.
It is not the upload URL’s deadline.
Upload the bytes
Within 15 minutes,PUT the bytes to presigned_url. Set Content-Type to the declared
mime_type and send exactly size bytes. Do not attach an API key.
file_id. A file with no uploaded
bytes is rejected with 400; finish its upload before retrying. See the selected model’s docs in
Model APIs for supported formats and file limits.
Create a generation
POST /generations accepts a JSON object containing model and input, at most 16 KiB. Put all
model-specific fields inside input; other top-level fields are rejected.
202 Accepted:
id before polling so you can resume checking the same generation if your client stops.
Poll a generation
GET /generations/{id} returns 200 OK with the generation resource. Poll every 5–10 seconds;
while work is pending, the response includes a Retry-After header in seconds. Respect that delay.
A successful response looks like this (URLs and timestamps are illustrative):
name. This example returns output.mp4 for the video, last_frame.png for its final
frame, and result.json for generation details. Check the model’s docs for its output files.
Download with GET against each signed URL, without an API key.
The URLs expire at expires_at, normally within a few minutes. Poll again to get fresh URLs. Result
files are retained for 48 hours after completion; after retention ends, requests for those results
return 410 generation_expired. Save the files in your own storage before then.
For a failed generation, files and expires_at are null, and error is an object:
Cancel a generation
SendDELETE /sessions/{id} using the generation ID, with the same API-key authentication.
The optional JSON body supplies a reason of at most 256 bytes:
200 OK with no body. Poll the generation to read its
final state. Cancellation produces failed with error code canceled and the supplied reason.
A clip that completed before cancellation remains succeeded.
Request errors and retries
HTTP errors describe a failed API request. They are separate from a generation resource withstatus: "failed". Error bodies can vary; inspect the HTTP status as well as the body. Validation
errors include error and message, for example:
POST /generations
A create request can count toward the account’s per-minute quota even when it returns
429 no_capacity.
A 429 quota_exceeded rejection does not consume another request allowance. The default limit is
10 per minute with a burst of 3; your account’s configured quota can differ. This allowance is shared
with streaming session creation.
Do not retry in a tight loop. If a create request loses its response, do not blindly resubmit: the
original request may already have started a generation.
GET /generations/{id}
Generation failure codes
Limits at a glance
See your model in Model APIs for supported durations
and file constraints.