HTTP API
The file service the CLI and both MCP servers call. Trade an API token for a session, then call it with that.
- Base URL
- fffs.freakingfast.io
- Requests
- POST, JSON
- Spec
- OpenAPI 3.1
Authenticate#
An API token doesn't call the file service itself. Trade it at /exchange-token for a session token, and send that as the bearer token, along with X-Absurd-App: fffd.
curl -X POST https://auth.freakingfast.io/exchange-token \
-H "Authorization: Bearer $FREAKING_FAST_API_TOKEN"{
"gelToken": "eyJhbGciOiJIUzI1NiIs…",
"expiresIn": 86400,
"userId": "73ad9b0e-7227-11ef-9399-bfdd82c9e268"
}The session lasts a day, as expiresIn says in seconds. Trade the token again before it runs out. Keep userId: new files go under users/{userId}/.
curl -X POST https://fffs.freakingfast.io/search-files \
-H "Authorization: Bearer $SESSION" \
-H "X-Absurd-App: fffd" \
-H "Content-Type: application/json" \
-d '{ "text": "harbor", "type": "Video" }'Upload a file#
Files go straight to storage on a signed form, so an upload never passes through the API.
Ask for a form
POST/generate-file-urls
- typestringrequired
- The kind of file, like
Video,AudioorImage. - fileNamestringrequired
- The name it shows under.
- fileSizeintegerrequired
- Its exact size in bytes, up to 2 TB.
- objectKeystringrequired
- Where it is stored:
users/{userId}/… - mimeTypestring
- Its content type.
You get an
uploadUrland anuploadForm. The form lasts 2 days.Send the file
POST the file to
uploadUrlasmultipart/form-data, with everyuploadFormfield before it, unchanged.Record it
POST/insert-file
Send the same fields with
isPublic: falseandcreator: { id: userId }. The service reads the stored size back, and turns the file down if it differs fromfileSize. You get the new file'sid.
Large files#
Above 64 MiB, send a file in parts instead, many at once. If an upload stops, start it again with the same objectKey and only the missing parts go up.
| Call | Does |
|---|---|
/create-multipart-upload | Opens the upload, or picks up the one already open under that key. |
/sign-upload-parts | Gives an upload URL for each part you ask for. |
/complete-multipart-upload | Joins the parts into the file. |
/insert-file | Records it, as for any upload. |
Share and download#
/generate-download-url gives a link to any of your files that lasts 6 hours. /toggle-file-access makes a file public, and its link then stays up for good, played from the closest region.
Endpoints#
Every route is a POST to https://fffs.freakingfast.io with a JSON body. The OpenAPI spec has the full request and response for each.
Upload#
| Route | Does |
|---|---|
/generate-file-urls | A signed form to upload a new file with. |
/insert-file | Record an uploaded file on the account. |
/create-multipart-upload | Start an upload in parts, or resume the one open under this key. |
/sign-upload-parts | Upload URLs for parts of an open upload. |
/complete-multipart-upload | Join the parts into the finished file. |
/abort-multipart-upload | Throw away an open upload and its parts. |
/import-from-url | Bring in a file from a link, fetched by the service. |
Find and read#
| Route | Does |
|---|---|
/select-user-files | Every file you made. |
/search-files | Find files by words, type, tag, folder, date, length, size, tempo, key or place. |
/read-file | What is in a file, for a model: an image, a frame, a PDF’s or text file’s text. |
/generate-download-url | A link to a file that lasts 6 hours. |
/get-user-storage-usage | Bytes and files by bucket and kind. |
Organize#
| Route | Does |
|---|---|
/tag-files | Tag files by name, making new tags as needed. |
/update-file-tags | Add one tag to files, or take it off. |
/move-files | Put files in a folder, by path or id. |
/update-file-description | Set a file’s description. |
/toggle-file-access | Make a file public or private. |
/select-collections | Your folders, playlists, galleries and tags. |
Playlists and galleries#
| Route | Does |
|---|---|
/create-playlist | A playlist of audio and video, in order. |
/add-to-playlist | Add to the end of a playlist. |
/reorder-playlist | Put a playlist in a new order. |
/create-gallery | A gallery of images, in order. |
/add-to-gallery | Add to the end of a gallery. |
/reorder-gallery | Put a gallery in a new order, and choose what goes up front. |
/set-cover | Put an image on a track or playlist as its art. |
/set-video-thumbnail | Set a video’s poster from a frame or an image. |
/create-archive-request | A ZIP of files, a gallery or a playlist. |
Requests and reviews#
| Route | Does |
|---|---|
/create-file-request | A link anyone can send files to. |
/select-file-requests | Your requests, and what arrived on each. |
/set-file-request-open | Close a request, or open it again. |
/create-file-review | A link to watch a video or track and leave notes on it. |
/select-file-reviews | Your reviews, each with its notes as an edit list. |
/reply-to-review-note | Answer a note. |
/set-review-note-resolved | Mark a note dealt with, or not. |
Activity#
| Route | Does |
|---|---|
/select-file-views | How often other people opened your files, and who. |
/select-drive-events | What happened in your drive after a point, oldest first. |
Images#
| Route | Does |
|---|---|
/generate-image | Start an image from a prompt, on your plan. |
/select-generations | How your generations are going, and what they made. |
Trash#
| Route | Does |
|---|---|
/trash-files | Move files to the trash. |
/restore-files | Bring files back. |
/select-trashed-files | What is in the trash. |
/purge-trashed-files | Empty the trash, for good. |
/delete-files | Delete files and what is stored for them, for good. |
Errors#
Errors come back with a sentence for people and a code for code. retryable says whether trying again could work, which the status alone doesn't tell you.
{
"error": "A fileSize is required",
"code": "missing_field",
"field": "fileSize",
"retryable": false
}| Status | Means |
|---|---|
| 400 | Something in the request is missing or wrong. field names it. |
| 401 | No session, or one that has expired. Trade the token again. |
| 403 | Signed in, but not allowed, or the account has no plan. |
| 404 | Nothing of yours has that id. |
| 500 | Something went wrong on our side. retryable is true. |