OkFile Agent-First Publishing
V1.4.1 | Files | Sites | Stream | API | CLI

File, Site & Video Publish ServiceDesigned for Agents

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.

🤖

API and CLI

Use one delivery flow across agents, scripts, and the Python CLI.

🔗

Quick to Multipart

Small files use quick upload, while larger ones switch to multipart automatically.

🌐

File and Site Publish

Publish single files or full folders with preserved paths and a dedicated site domain.

📦

Batch Uploads

Handle multiple files in one run and keep the same upload flow across the whole batch.

🔒

Guest or API Key

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.

📷

Links and Preview

Return direct file links together with preview or playback pages, or switch a file to burn-after-read for one-time access.

🎬

Video to Streaming Media

Upload a video with --stream and get adaptive HLS/DASH playback URLs via Cloudflare Stream, no Cloudflare account needed.

01Agent Skill

Use this when you want an agent-ready integration flow.

OkFile Skill

Covers config discovery, file upload, and static site publishing with the same flow used by the Python CLI.

Skill Name
okfile
Version
V1.4.1
Doc Location
Trigger Scenario
Publish files or full static sites through one consistent API and CLI flow.
Supported Types
Images, videos, PDFs, common files, static site folders, and video-to-streaming transcoding (guest uploads up to 1GB per file, API Key uploads up to 1TB per file).
API Endpoints
GET /api/upload/config, POST /api/upload/quick, POST /api/upload/prepare, PUT uploadUrl, POST /api/upload/complete, POST /api/site/prepare, POST /api/site/complete, POST /api/stream/prepare, GET /api/stream/status/{uid}
Auth Method
Anonymous uploads are IP rate-limited and currently expire after 24 hours. Logged-in users can publish with API Keys for up to 1TB per file.
Return Value
{success, id, url, downloadUrl, playUrl, type, burnAfterRead} or {siteUrl, entryUrl}
Integration Flows
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

02CLI Install

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.

Recommended Source
PyPI: `py -3 -m pip install okfile`
Filename
`okfile-1.4.1-py3-none-any.whl`
Command Name
`okfile`
Install Type
PyPI package for Python 3.10+, direct `wheel` install as fallback
Install and Use
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"

03API Docs

Start with config, then upload files or publish sites. File uploads can also request one-time burn-after-read links.

Quick Start
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"}]}'
MethodEndpointDescription
GET/api/upload/configDiscover current quick-upload, multipart, retention, and size limits before starting automation.
POST/api/upload/quickUpload a small file directly and receive the same final response shape as upload complete, including optional burnAfterRead.
POST/api/upload/prepareRequest a single-upload or multipart upload URL and receive the future public file URLs, with optional one-time burn-after-read behavior.
PUTuploadUrl / parts[].uploadUrlUpload the file body or each file part directly.
POST/api/upload/completeFinalize the upload using the returned file id.
GET/api/upload/status/{id}Query multipart upload progress and status.
POST/api/site/prepareCreate a publish session for a static site folder.
POST/api/site/completeFinalize static site publishing and receive the site URLs.
POST/api/stream/prepareHosted 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=1Preview or playback page for images, videos, and PDFs. Burn-after-read preview links now expire after the first successful open.