Publish files or full static sites through one flow across API, CLI, and manual upload.
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, then switch to API Keys for higher limits and control.
Return direct file links together with preview or playback pages when the file type supports it.
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
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.
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"
Start with config, then upload files or publish sites.
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"}]}'
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/upload/config | Discover current quick-upload, multipart, 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. |
| POST | /api/upload/prepare | Request a single-upload or multipart upload URL and receive the future public file URLs. |
| 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. |
| GET | /i/{id} | Direct file URL. |
| GET | /i/{id}?play=1 | Preview or playback page for images, videos, and PDFs. |