CommonThread Developer API
REST API Reference

Developer File Upload API

Integrate file and media uploads directly into your apps, websites, scripts, or bots. Upload any file type (images, PDF, .txt, .bat, audio, video, documents) and receive a permanent direct URL.

Premium API Tier

Need to upload files larger than 20MB?

Upgrade to a Premium Developer API Token powered by Cloudflare R2. Upload large media, PDFs, datasets, videos, and archives up to 500MB with ultra-fast speed and zero bandwidth fees.

POST https://media-hosting.dhyeyp254.workers.dev/api/upload

Accepts multipart form-data, JSON with a remote URL, or Base64 data.

Parameters

file The file to upload (multipart/form-data). Supports any format (e.g. .png, .pdf, .bat, .txt, .mp4).
url Optional remote URL (application/json) to download and host directly.
X-API-Key Optional header if an API key is configured on the server.

Response (200 OK)

{
  "success": true,
  "url": "https://media-hosting.dhyeyp254.workers.dev/1794849181001_81n59t.bat",
  "filename": "my_script.bat",
  "size": 1024,
  "size_formatted": "1.00 KB",
  "mime_type": "application/x-bat",
  "uploaded_at": "2026-11-16T17:40:00.000Z"
}

Integration Code Snippets

curl -X POST https://media-hosting.dhyeyp254.workers.dev/api/upload   -F "file=@/path/to/any_file.pdf"

Live API Tester

Test uploading from your browser
Copied!