Back to all guides
Topic:Developers
Developer Tutorials & SDKsSDK v1.2+

File Upload API 2026: S3-Compatible SDK & Direct Cloudinary Alternative | ICBucket

Building a media upload pipeline in 2026 should not require complex AWS IAM roles, expensive Cloudinary credit packs, or fragile IPFS pinning gateways. Meet icpay-bucket: the open-source, S3-compatible file upload API for the Internet Computer that gives you high-speed uploads and instant CDN delivery with zero egress fees.

ICPay
By ICPay TeamOfficial

October 12, 2026

12 min read
File Upload API 2026: S3-Compatible SDK and Direct Cloudinary Alternative Architecture
Official SDKs: npm install icpay-bucket | pip install icpay-bucket

Quick Installation

npm install icpay-bucketTypeScript / Node
pip install icpay-bucketPython 3.9+

1. Why Modern Developers Need an S3 Upload API Alternative

When developers need to add user avatars, PDF invoice generation, or video uploads to their web apps, they typically choose between two frustrating extremes:

Extreme A: AWS S3 + Pre-Signed URLs

Requires configuring IAM users, bucket policies, CORS headers, STS token generation, and backend servers to sign PUT requests. Once running, you face $0.09/GB egress bills whenever users download files.

Extreme B: Cloudinary / Uploadcare

Easy to set up initially, but triggers aggressive pricing cliffs ($89 to $499/month) once your application exceeds modest free-tier credit allowances.

icpay-bucket bridges the gap: a clean, unified file upload API with the simplicity of Cloudinary, the S3 standard compatibility, and the cost efficiency of the Internet Computer.

2. Complete TypeScript & Next.js Upload Tutorial

Here is how to set up an end-to-end file upload API route in Next.js or Node.js using icpay-bucket:

// app/api/upload/route.ts
import { BucketClient } from "icpay-bucket"

const client = new BucketClient({
  apiKey: process.env.ICBUCKET_API_KEY, // Scoped API Key from icpay.app
})

export async function POST(req: Request) {
  const formData = await req.formData()
  const file = formData.get("file") as File

  if (!file) {
    return Response.json({ error: "No file provided" }, { status: 400 })
  }

  const bytes = new Uint8Array(await file.arrayBuffer())

  // Upload to on-chain ICBucket
  const result = await client.uploadFile({
    bucketId: "production-uploads",
    path: `/documents/${Date.now()}-${file.name}`,
    data: bytes,
    contentType: file.type || "application/octet-stream",
  })

  if ("err" in result) {
    return Response.json({ error: result.err }, { status: 500 })
  }

  // Instant public CDN delivery URL:
  const publicUrl = client.publicUrl("production-uploads", result.ok.path)

  return Response.json({
    success: true,
    path: result.ok.path,
    url: publicUrl, // https://cdn.icpay.app/production-uploads/documents/...
  })
}

3. Python File Upload API (FastAPI & Django)

For Python backend engineers, the package is published on PyPI as icpay-bucket:

import os
from icpay_bucket import BucketClient

client = BucketClient(api_key=os.environ["ICBUCKET_API_KEY"])

# Uploading a document
with open("contract.pdf", "rb") as f:
    data = f.read()

result = client.upload_file(
    bucket_id="legal-docs",
    path="/contracts/2026/nda.pdf",
    data=data,
    content_type="application/pdf",
)

if "ok" in result:
    print("Uploaded successfully:", result["ok"])
    print("Public CDN URL:", client.public_url("legal-docs", "/contracts/2026/nda.pdf"))
else:
    print("Upload failed:", result["err"])

4. Enterprise Features Built into the SDK

Automatic Indexed Chunking

Files larger than 1.85 MB are automatically sliced and uploaded using concurrent worker pools, guaranteeing resilient transmission even over unstable mobile network connections.

Scoped Security & Permissions

Generate API keys with granular Read, Write, and Delete permissions. You can issue write-only keys to client upload forms without exposing delete capabilities.

Zero Egress Bandwidth Fees

Unlike AWS S3 or Cloudinary, public downloads and edge CDN views carry zero bandwidth charges. You pay a flat, predictable rate of ~$5 per gigabyte per year.

Start Building with icpay-bucket Today

Create an on-chain bucket in 60 seconds, generate your API key, and install the package from npm or PyPI.

Frequently Asked Questions (FAQ)

What is icpay-bucket?

icpay-bucket is the official developer SDK for ICBucket, available on npm (TypeScript/Node.js) and PyPI (Python). It provides an S3-compatible file upload API to store files directly on-chain on the Internet Computer with scoped API keys, automatic chunking, and public CDN links.

How does the ICBucket file upload API handle large files?

The SDK automatically divides files larger than 1.85 MB into indexed chunks, dispatching them through concurrent worker pools directly to boundary nodes. Chunks are reassembled in 64-bit Wasm stable memory inside the target storage canister.

Can I use icpay-bucket as an alternative to Cloudinary or AWS S3 upload APIs?

Yes. icpay-bucket provides identical functionality: you pass an API key and a file buffer or stream. You receive a persistent CDN URL (https://cdn.icpay.app/...) with zero outbound bandwidth egress taxes and predictable 30-day ICP plans.

Where are packages published?

icpay-bucket is published on npm for Node.js/TypeScript (npm install icpay-bucket) and on PyPI for Python (pip install icpay-bucket), with official source repositories and documentation on icpay.app.