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

File & Site Publish ServiceDesigned for Agents

Publish files or full static sites through one flow across API, CLI, and manual upload.

Open npm Package Visit Website GitHub
🤖

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, then switch to API Keys for higher limits and control.

📷

Links and Preview

Return direct file links together with preview or playback pages when the file type supports it.

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.2.3
Doc Location
Trigger Scenario
Publish files or full static sites through one consistent API and CLI flow.
Supported Types
Images, videos, PDFs, common files, and static site folders (≤500MB 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
Auth Method
Anonymous uploads are IP rate-limited. Logged-in users can publish with API Keys.
Return Value
{success, id, url, downloadUrl, playUrl, type} 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

02CLI Install

Use npm for Node-friendly runs, PyPI for Python installs, and keep the wheel as a fallback.

The current CLI release is available as an npm launcher, a PyPI package, and a direct wheel download.

Recommended Source
Node launcher: `npx @okfilecom/okfile --version`
Filename
`okfile-1.2.3-py3-none-any.whl`
Command Name
`okfile`
Install Type
npm launcher for Node workflows, PyPI for Python workflows, direct `wheel` as fallback
Install Commands
npx @okfilecom/okfile --version

npx @okfilecom/okfile upload ./photo.jpg

npx @okfilecom/okfile publish ./my-site

py -3 -m pip install okfile==1.2.3

py -3 -m pip install --upgrade okfile

py -3 -m pip install "https://www.okfile.com/downloads/okfile-1.2.3-py3-none-any.whl"

03API Docs

Start with config, then upload files or publish sites.

Quick Start
curl "https://www.okfile.com/api/upload/config"

curl -X POST "https://www.okfile.com/api/upload/quick" \
  -F "[email protected]"

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}'

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, and size limits before starting automation.
POST/api/upload/quickUpload a small file directly and receive the same final response shape as upload complete.
POST/api/upload/prepareRequest a single-upload or multipart upload URL and receive the future public file URLs.
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.
GET/i/{id}Direct file URL.
GET/i/{id}?play=1Preview or playback page for images, videos, and PDFs.