Quick start
Create a key
In your account, open API and click Create Key. Keys come with every paid plan.
Start the upload
Send the names and sizes of your files. You get the link and an address for each file.
Send the files
Send each file to its address. People can download while it uploads.
# Start the upload
curl https://api.fileport.io/v1/uploads \
-H "Authorization: Bearer $FILEPORT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"files": [{"name": "report.pdf", "size": 48213377}]}'
# Send the file to the uploadUrl in the answer
curl -T report.pdf "$UPLOAD_URL"import { openAsBlob } from 'node:fs'
const file = await openAsBlob('report.pdf')
const res = await fetch('https://api.fileport.io/v1/uploads', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.FILEPORT_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ files: [{ name: 'report.pdf', size: file.size }] }),
})
const upload = await res.json()
console.log(upload.link)
await fetch(upload.files[0].uploadUrl, { method: 'PUT', body: file })import os
import requests
size = os.path.getsize("report.pdf")
upload = requests.post(
"https://api.fileport.io/v1/uploads",
headers={"Authorization": f"Bearer {os.environ['FILEPORT_API_KEY']}"},
json={"files": [{"name": "report.pdf", "size": size}]},
).json()
print(upload["link"])
with open("report.pdf", "rb") as f:
requests.put(upload["files"][0]["uploadUrl"], data=f){
"id": "Kd7pQx3mRt9a",
"product": "send",
"name": "report.pdf",
"link": "https://fileport.io/Kd7pQx3mRt9a",
"expiresAt": "2026-12-17T12:00:00.000Z",
"files": [
{
"index": 0,
"name": "report.pdf",
"size": 48213377,
"parts": 1,
"uploadUrl": "https://eu-central-3f9a12c4.fileport.io/v1/files/eyJ…/eyJ…"
}
]
}API keys
Sending your key
Send it in the Authorization header after Bearer: Authorization: Bearer fpk_…
Use keys on your servers only. Browsers can't call the API, so a key in a web page never works.
Uploading files
Files up to 100 MB go in one request, and bigger ones in 100 MB parts
Large files
Send parts to the file's address with ?part=1, ?part=2 and on, in any order and several at once. The file finishes when every part is in.
Many files
Every file has its own address. Send them one after another or several at once.
Dropped connections
Send that part again. A GET on the address lists the parts that arrived, so a script that restarts can carry on.
# Cut a 2.5 GB file into 100 MB parts, then send part 1, 2, 3 and on split -b 100000000 video.mov part- n=1 for part in part-*; do curl -T "$part" "$UPLOAD_URL?part=$n" n=$((n + 1)) done
import { openAsBlob } from 'node:fs'
const PART = 100_000_000
const file = await openAsBlob('video.mov')
for (let part = 1; (part - 1) * PART < file.size; part++) {
const body = file.slice((part - 1) * PART, part * PART)
await fetch(`${uploadUrl}?part=${part}`, { method: 'PUT', body })
}PART = 100_000_000
with open("video.mov", "rb") as f:
part = 1
while data := f.read(PART):
requests.put(f"{upload_url}?part={part}", data=data)
part += 1An upload ends when no bytes arrive for 4 hours, or for 24 hours from 2 GB up
{
"id": "Kd7pQx3mRt9a",
"product": "send",
"name": "Q3 report",
"link": "https://fileport.io/Kd7pQx3mRt9a",
"size": 48213377,
"expiresAt": "2026-12-17T12:00:00.000Z",
"finished": true,
"downloads": 3,
"downloadUrl": "https://fileport.io/get/eyJ…",
"downloadUrlExpiresAt": "2026-11-19T12:00:00.000Z",
"files": [
{ "index": 0, "name": "report.pdf", "size": 48213377, "finished": true }
]
}Once finished is true, the download link is the file itself, or a ZIP of every file, and works for 2 days without counting as a download. A photobook's answer has its album link only.
Limits and errors
Errors
An error answers with its status and {"error": {"code": "…", "message": "…"}}. A 429 says in Retry-After how many seconds to wait.
export FILEPORT_API_KEY=fpk_… npx @fileport/cli send ./build
claude mcp add fileport -e FILEPORT_API_KEY=fpk_… -- npx -y @fileport/cli mcp
{
"mcpServers": {
"fileport": {
"command": "npx",
"args": [
"-y",
"@fileport/cli",
"mcp"
],
"env": {
"FILEPORT_API_KEY": "fpk_…"
}
}
}
}{
"mcpServers": {
"fileport": {
"command": "npx",
"args": [
"-y",
"@fileport/cli",
"mcp"
],
"env": {
"FILEPORT_API_KEY": "fpk_…"
}
}
}
}{
"servers": {
"fileport": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@fileport/cli",
"mcp"
],
"env": {
"FILEPORT_API_KEY": "${input:fileport-key}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "fileport-key",
"description": "Fileport API key",
"password": true
}
]
}Give an AI assistant an Upload Only key, so it can't see or delete your uploads