Install
openclaw skills install @okfilecom/okfileUploads and publishes files or static site folders to OkFile, with direct links, preview URLs, and multipart support. Use when the user asks to upload, publish, or share files or folders.
openclaw skills install @okfilecom/okfileOfficial site: https://www.okfile.com/
OkFile is an agent-first file upload and publish service. Use this skill when an agent needs to:
POST /api/upload/quick when the file is within the advertised quick-upload limitindex.htmlurlplayUrlsiteUrl or entryUrlChoose this skill when the user asks to:
index.htmlGET /api/upload/configquickUploadMaxSize, multipartThreshold, and partSizePOST /api/upload/quick for small files, or prepare -> PUT -> complete for normal and large uploadsPOST /api/upload/quick with multipart/form-dataPOST /api/upload/completePOST /api/upload/preparePUT uploadUrl or each parts[].uploadUrlPOST /api/upload/completePOST /api/site/preparePOST /api/site/completeStatic site behavior:
index.html exists, the site root renders that pageindex.html does not exist, the site root renders a directory listing with file name, size, and upload timecurl -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/quick" \
-F "file=@photo.jpg"
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"
okfile upload photo.jpg
okfile upload photo.jpg --max-downloads 10
okfile upload photo.jpg --expires-at 2026-12-31T23:59:59Z
okfile publish ./my-site/
okfile publish ./my-site/ --expires-at 2026-12-31T23:59:59Z
okfile status a3k7m92x
okfile status a3k7m92x --verbose
okfile config --key okf_xxxxx
okfile config --clear-origin
okfile --version
Prefer installing the latest published PyPI package:
py -3 -m pip install okfile
okfile --version
If you need a pinned install for reproducibility:
py -3 -m pip install okfile==1.2.3
Upgrade an existing install:
py -3 -m pip install --upgrade okfile
If you need a direct static artifact instead of PyPI, install the wheel from OkFile:
py -3 -m pip install "https://www.okfile.com/downloads/okfile-1.2.3-py3-none-any.whl"
Debugging tips:
okfile upload photo.jpg --origin https://www.okfile.com --verbose
okfile status invalid_id --verbose
GET /api/upload/config to discover the current quick-upload and multipart thresholds instead of hardcoding themPOST /api/upload/quick for small files when size <= quickUploadMaxSizeapiKey is optional and is only sent to prepare--max-downloads and --expires-at are supported by the CLI for file uploads; --expires-at is also supported for site publishokfile config --clear-origin removes the stored default origin and falls back to https://www.okfile.com--verbose prints traceback details for debugging request or parsing failurescomplete only needs idcomplete returns missingParts, re-upload only those partsurl; return playUrl when preview mattersUse anonymous mode for direct publishing without login.
Use API key mode for controlled, long-term, or team-managed usage. Flow:
POST /api/auth/request-link/accountapiKey in POST /api/upload/prepareGET /api/upload/configResponse example:
{
"success": true,
"maxSize": 524288000,
"quickUploadMaxSize": 5242880,
"multipartThreshold": 26214400,
"partSize": 10485760
}
Notes:
quickUploadMaxSize indicates when /api/upload/quick can be usedPOST /api/upload/prepareRequest body:
{
"filename": "photo.jpg",
"size": 12345,
"contentType": "image/jpeg",
"preferredPartSize": 5242880,
"apiKey": "okf_..."
}
Notes:
preferredPartSize is optional5MB to 100MBsingle or multipartexpiresIn refers to the signed uploadUrl or parts[].uploadUrl lifetime only; it does not describe a separate Worker-side upload-session TTLcomplete says the upload session was not found, first verify that you are using the exact same id returned by that specific prepare call
Single upload response example:{
"success": true,
"id": "a3k7m92x",
"mode": "single",
"uploadUrl": "https://upload.example.com/...",
"expiresIn": 3600,
"method": "PUT",
"url": "https://www.okfile.com/i/a3k7m92x",
"playUrl": "https://www.okfile.com/i/a3k7m92x?play=1",
"type": "image"
}
Multipart response example:
{
"success": true,
"id": "a3k7m92x",
"mode": "multipart",
"uploadId": "3c4d...",
"partSize": 5242880,
"totalParts": 33,
"parts": [
{ "partNumber": 1, "uploadUrl": "https://..." }
],
"url": "https://www.okfile.com/i/a3k7m92x",
"playUrl": "https://www.okfile.com/i/a3k7m92x?play=1",
"type": "video"
}
POST /api/upload/quickRequest:
multipart/form-datafile fieldexpiresAt and maxDownloads follow the normal upload semantics
Success response example:{
"success": true,
"id": "a3k7m92x",
"url": "https://www.okfile.com/i/a3k7m92x",
"downloadUrl": "https://www.okfile.com/d/a3k7m92x",
"playUrl": "https://www.okfile.com/i/a3k7m92x?play=1",
"type": "image"
}
Notes:
complete response so clients can reuse downstream logicPUT uploadUrl or parts[].uploadUrlPUTPUT per partContent-Length explicitlyPOST /api/upload/completeRequest body:
{
"id": "a3k7m92x"
}
Success response example:
{
"success": true,
"id": "a3k7m92x",
"url": "https://www.okfile.com/i/a3k7m92x",
"playUrl": "https://www.okfile.com/i/a3k7m92x?play=1",
"type": "image"
}
Incomplete multipart response example:
{
"success": false,
"error": "Missing parts",
"uploadedParts": 45,
"totalParts": 50,
"missingParts": [4, 12, 28, 44, 49]
}
GET /api/upload/status/{id}Response example:
{
"id": "a3k7m92x",
"status": "uploading",
"progress": "45/50",
"uploadedParts": 45,
"totalParts": 50,
"bytesReceived": 471859200
}
POST /api/site/prepareRequest body:
{
"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" },
{ "path": "images/logo.png", "size": 4200, "contentType": "image/png" }
]
}
Notes:
entryPath entirely when the uploaded folder has no root index.htmlindex.html just to mimic a directory listingindex.html is absent, OkFile generates the directory listing automaticallyassets/app.css, not local absolute pathsdocs/getting-started.md or images/icons/logo.svgsiteToken is bound to one specific site/prepare response and should be passed to the matching site/complete; do not mix tokens across runs
Success response example:{
"success": true,
"siteId": "st_ab12cd34",
"siteToken": "token",
"siteHostname": "st-ab12cd34.ok26.org",
"siteUrl": "https://st-ab12cd34.ok26.org/",
"entryUrl": "https://st-ab12cd34.ok26.org/",
"uploadStrategy": "reuse-file-upload-api"
}
POST /api/site/completeRequest body:
{
"siteId": "st_ab12cd34",
"siteToken": "token",
"files": [
{ "relativePath": "docs/getting-started.md", "fileId": "f1a2b3c4" },
{ "relativePath": "assets/app.css", "fileId": "d4e5f6g7" },
{ "relativePath": "images/logo.png", "fileId": "h7i8j9k0" }
]
}
Success response example:
{
"success": true,
"siteId": "st_ab12cd34",
"siteHostname": "st-ab12cd34.ok26.org",
"siteUrl": "https://st-ab12cd34.ok26.org/",
"entryUrl": "https://st-ab12cd34.ok26.org/",
"entryPath": "index.html"
}
Prefer returning:
url for direct consumption, download, embedding, or API useplayUrl for image preview, video playback, or PDF viewingsiteUrl for the root of a published static siteentryUrl for the preferred HTML entry page, or the same value as siteUrl when the site uses directory listing
For video or PDF, returning both is usually best.Use the CLI when the user wants a local command-line workflow instead of raw HTTP requests.
Recommended commands:
okfile upload photo.jpg
okfile publish ./my-site/
okfile status a3k7m92x
okfile config --key okf_xxxxx
okfile config --clear-origin
okfile --version
Recommended install path:
py -3 -m pip install okfile
Pinned install example:
py -3 -m pip install okfile==1.2.3
Use the CLI when:
JPG, JPEG, PNG, GIF, WebP, BMP, SVGMP4, WebM, MOV, AVI, MKVPDF500MBGET /api/upload/config, typically <= 5MBGET /api/upload/config before automation runs that need dynamic thresholdsquick for small files and reserve prepare -> PUT -> complete for larger payloadsprepare -> PUT -> completeprepare response values (id, and for site publishing also siteId + siteToken) from the same execution context until complete finishesUser-Agent on prepare and completeContent-Length on each PUT2xx statusmissingParts, not the whole fileindex.html at the site root when you want the subdomain homepage to render a page immediatelyindex.html out and use the generated listing pageindex.html; upload the real folder tree and let OkFile render the listing automatically/docs/guide/ and /assets/app.csshttps://www.okfile.com/en/https://www.okfile.com/en/upload/https://www.okfile.com/accounthttps://www.okfile.com/adminhttps://pypi.org/project/okfile/https://www.okfile.com/downloads/okfile-1.2.3-py3-none-any.whlokfile_cli/__main__.py