Get a public direct link for any file, publish an entire folder as a website on its own subdomain, or turn a video into streaming media with HLS/DASH playback URLs — one flow across API, CLI, and manual upload, including one-time burn-after-read links for sensitive files.
Use one delivery flow across agents, scripts, and the Python CLI.
Small files use quick upload, while larger ones switch to multipart automatically.
Publish single files or full folders with preserved paths and a dedicated site domain.
Handle multiple files in one run and keep the same upload flow across the whole batch.
Start with guest upload for quick tasks at 1GB per file with 24-hour retention, then switch to API Keys for uploads up to 1TB per file.
Return direct file links together with preview or playback pages, or switch a file to burn-after-read for one-time access.
Upload a video with --stream and get adaptive HLS/DASH playback URLs via Cloudflare Stream, no Cloudflare account needed.
Use this when you want an agent-ready integration flow.
Covers config discovery, file upload, and static site publishing with the same flow used by the Python CLI.
Publish File
1. GET /api/upload/config
2. If size <= quickUploadMaxSize, POST /api/upload/quick
3. Otherwise POST /api/upload/prepare
4. PUT to uploadUrl or each parts[].uploadUrl
5. POST /api/upload/complete
Publish Site
1. POST /api/site/prepare
2. Upload each site file through quick or standard file flow and collect fileId values
3. POST /api/site/complete
4. Return siteUrl and entryUrl
Publish Video as Streaming Media
1. POST /api/stream/prepare with uploadLength and filename
2. Upload with the tus protocol to the returned one-time uploadUrl
3. GET /api/stream/status/{uid} until readyToStream
4. Return the /s/{uid} player page plus HLS and DASH playback URLs
Install the Python CLI from PyPI, and keep the direct wheel download as a fallback.
The current CLI release is a Python package on PyPI with a direct wheel download fallback, supporting quick and multipart uploads, site publishing, retries with resume, and burn-after-read links.
py -3 -m pip install okfile
curl -fsSL https://www.okfile.com/install.sh | sh
iwr -useb https://www.okfile.com/install.ps1 | iex
okfile --version
okfile upload ./photo.jpg
okfile upload ./secret.pdf --burn-after-read
okfile upload ./video.mp4 --stream
okfile publish ./my-site
py -3 -m pip install "https://www.okfile.com/downloads/okfile-1.4.1-py3-none-any.whl"
Start with config, then upload files or publish sites. File uploads can also request one-time burn-after-read links.
curl "https://www.okfile.com/api/upload/config"
curl -X POST "https://www.okfile.com/api/upload/quick" \
-F "[email protected]" \
-F "burnAfterRead=true"
curl -X POST "https://www.okfile.com/api/upload/prepare" \
-H "Content-Type: application/json" \
--data '{"filename":"photo.jpg","size":12345,"contentType":"image/jpeg","preferredPartSize":5242880,"burnAfterRead":true}'
curl -X POST "https://www.okfile.com/api/upload/complete" \
-H "Content-Type: application/json" \
--data '{"id":"a3k7m92x"}'
curl "https://www.okfile.com/api/upload/status/a3k7m92x"
curl -X POST "https://www.okfile.com/api/site/prepare" \
-H "Content-Type: application/json" \
--data '{"siteName":"docs-site","files":[{"path":"docs/getting-started.md","size":1200,"contentType":"text/markdown; charset=utf-8"},{"path":"assets/app.css","size":3200,"contentType":"text/css; charset=utf-8"}]}'
curl -X POST "https://www.okfile.com/api/site/complete" \
-H "Content-Type: application/json" \
--data '{"siteId":"st_xxxx","siteToken":"token_xxxx","files":[{"relativePath":"docs/getting-started.md","fileId":"a3k7m92x"},{"relativePath":"assets/app.css","fileId":"b8f2k19a"}]}'
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/upload/config | Discover current quick-upload, multipart, retention, and size limits before starting automation. |
| POST | /api/upload/quick | Upload a small file directly and receive the same final response shape as upload complete, including optional burnAfterRead. |
| POST | /api/upload/prepare | Request a single-upload or multipart upload URL and receive the future public file URLs, with optional one-time burn-after-read behavior. |
| PUT | uploadUrl / parts[].uploadUrl | Upload the file body or each file part directly. |
| POST | /api/upload/complete | Finalize the upload using the returned file id. |
| GET | /api/upload/status/{id} | Query multipart upload progress and status. |
| POST | /api/site/prepare | Create a publish session for a static site folder. |
| POST | /api/site/complete | Finalize static site publishing and receive the site URLs. |
| POST | /api/stream/prepare | Hosted video transcoding: get a one-time tus upload URL for Cloudflare Stream, no Cloudflare account needed. |
| GET | /api/stream/status/{uid} | Stream processing state plus watch, HLS, DASH, and thumbnail URLs. |
| GET | /s/{uid} | Shareable web player page for a stream video; embeds an HLS player and auto-refreshes while transcoding. |
| GET | /i/{id} | Direct file URL. When burnAfterRead=true, the first successful read invalidates the file. |
| GET | /i/{id}?play=1 | Preview or playback page for images, videos, and PDFs. Burn-after-read preview links now expire after the first successful open. |