Quickstart

All objects live in buckets. A bucket belongs to one account and can be pinned to a region. Uploads and downloads go through any edge node, for example ne1cdn.krusty.pro.

Signed URLs

Edge nodes never serve objects without a signature. Build the string METHOD\nPATH\nEXPIRES, sign it with your bucket key using HMAC-SHA256 and append expires and sig to the URL.

import hmac, hashlib, time
expires = int(time.time()) + 3600
path = "/v1/media/clip-0412.mp4"
msg = f"GET\n{path}\n{expires}".encode()
sig = hmac.new(BUCKET_KEY, msg, hashlib.sha256).hexdigest()
url = f"https://ne1cdn.krusty.pro{path}?expires={expires}&sig={sig}"

Uploading objects

Use PUT /v1/buckets/{bucket}/objects/{key} with an API token. Objects larger than 100 MB should use multipart upload.

curl -X PUT -H "Authorization: Bearer $TOKEN" \
     --data-binary @clip-0412.mp4 \
     https://ne1cdn.krusty.pro/v1/buckets/media/objects/clip-0412.mp4

Downloading

Edge nodes support Range requests, If-None-Match and HTTP/2. A cached object is marked with cache-status: edge; hit.

Errors

Errors are returned as JSON with a request id that support can trace.

StatusCodeMeaning
403forbiddenMissing or invalid signature
403expiredThe link has expired
404not_foundNo such object in the bucket
429rate_limitedToo many requests from one client
{"error":{"code":"not_found","message":"Object not found"},"request_id":"…"}

Limits

LimitValue
Object size5 TB
Link lifetimeup to 7 days
Requests per client600 per minute per edge node