ImgCourier.

Quickstart

This guide gets an image from your laptop to a resized AVIF on the edge in about five minutes. You need an account (the Free plan is fine) and a secret key from Dashboard → API keys.

shell
# Store your key in an environment variable
export IC_SECRET_KEY="sk_live_3fa1…"

# Upload an original
curl -X POST https://api.imgcourier.online/v1/images \
  -H "Authorization: Bearer $IC_SECRET_KEY" \
  -F "file=@./hero.jpg" \
  -F "path=blog/2026/hero.jpg"

The response contains the delivery URL. Append parameters to it to get variants:

response.json
{
  "id": "img_01JF8Q2V7M4ZC9T6",
  "path": "blog/2026/hero.jpg",
  "width": 3840,
  "height": 2160,
  "bytes": 2914402,
  "content_type": "image/jpeg",
  "url": "https://cdn.imgcourier.online/acme/blog/2026/hero.jpg",
  "created_at": "2026-11-02T09:41:17Z"
}

Then use it like any other image: https://cdn.imgcourier.online/acme/blog/2026/hero.jpg?w=1200&fmt=auto.

Concepts

Account slug. The first path segment of every delivery URL (acme above). It is chosen at sign-up and identifies whose images to serve.

Source. Where originals live: ImgCourier storage, or an S3-compatible bucket you connect. Each source gets its own path prefix.

Variant. A specific rendering of an original — a combination of size, crop, format and quality. Variants are cached at the edge for 365 days and invalidated automatically when the original changes.

Authentication

The management API at https://api.imgcourier.online/v1 uses bearer tokens. Secret keys start with sk_live_ or sk_test_; never ship them to the browser. For uploads from the browser, mint a short-lived upload token on your server:

server.js
import { ImgCourier } from "@imgcourier/node";

const ic = new ImgCourier({ secretKey: process.env.IC_SECRET_KEY });

app.post("/upload-token", async (req, res) => {
  const token = await ic.uploadTokens.create({
    pathPrefix: `users/${req.user.id}/`,
    maxBytes: 15 * 1024 * 1024,
    expiresIn: 600, // seconds
  });
  res.json({ token: token.value });
});

Delivery URLs on cdn.imgcourier.online are public by default. To restrict them, enable signed URLs on the source.

URL parameters

Parameters are applied in a fixed order (crop → resize → adjust → encode), regardless of the order in the query string.

ParamValuesDescription
w, h1–8192Target width and height in CSS pixels.
dpr1–4Device pixel ratio multiplier. w=400&dpr=2 renders 800 px.
fitclip · cover · contain · fill · smartHow the image fills the box. smart uses subject detection.
gravitycenter, north, … face, x,yAnchor for cover crops. Coordinates are 0–1 fractions.
fmtauto · avif · webp · jpeg · pngOutput format. auto negotiates from the Accept header.
q1–100Encoder quality. Defaults are tuned per format (AVIF 52, WebP 76, JPEG 80).
bghex colourBackground for contain padding and flattened transparency.
blur0–250Gaussian blur radius. Handy for low-quality placeholders.
sharp0–10Unsharp mask after downscaling.
rot90 · 180 · 270Rotation applied after EXIF orientation.
trim0–100Removes uniform borders within the given colour tolerance.
examples
# Square product tile, subject kept in frame
https://cdn.imgcourier.online/acme/products/lamp-07.jpg?w=480&h=480&fit=smart

# Retina hero, best format for the browser
https://cdn.imgcourier.online/acme/blog/2026/hero.jpg?w=1440&dpr=2&fmt=auto

# 24px blurred placeholder for lazy-loading
https://cdn.imgcourier.online/acme/blog/2026/hero.jpg?w=24&blur=40&q=30

Formats

Inputs: JPEG, PNG, WebP, AVIF, HEIC, GIF (first frame), TIFF and SVG (rasterised; served as-is when no parameters are given). Maximum input size is 60 megapixels and 50 MB.

With fmt=auto, the response carries Vary: Accept and our edge stores one copy per negotiated format, so caches downstream of us behave correctly.

Presets

Presets give a name to a set of parameters so your templates stay short and you can retune sizes without a deploy.

shell
curl -X PUT https://api.imgcourier.online/v1/presets/card \
  -H "Authorization: Bearer $IC_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"w": 600, "h": 400, "fit": "smart", "fmt": "auto", "q": 70}'

# Use it
https://cdn.imgcourier.online/acme/p/card/products/lamp-07.jpg

Signed URLs

When signing is required, each URL must carry an s parameter: the first 16 bytes of an HMAC-SHA256 over the path and query, hex-encoded, using the source’s signing secret.

sign.js
import { createHmac } from "node:crypto";

export function signUrl(path, params, secret) {
  const qs = new URLSearchParams(params);
  qs.sort();
  const base = `${path}?${qs}`;
  const s = createHmac("sha256", secret).update(base).digest("hex").slice(0, 32);
  return `https://cdn.imgcourier.online${base}&s=${s}`;
}

signUrl("/acme/products/lamp-07.jpg", { w: 800, fmt: "auto" }, process.env.IC_SIGNING_SECRET);

Presets can be marked public, which lets them be requested without a signature even when signing is enforced for the source. This is the easiest way to protect against arbitrary sizes while keeping templates simple.

Uploads

POST/v1/images

Multipart upload of a single file, or JSON with a source_url to fetch from. Send an Idempotency-Key header to make retries safe. Uploading to an existing path replaces the original and invalidates its variants.

GET/v1/images?prefix=products/&limit=100

Lists originals, newest first. Paginate with the cursor value from the previous response.

DELETE/v1/images/{id}

Removes the original and purges all variants. Deletion propagates to every edge location within 30 seconds.

Purging

shell
curl -X POST https://api.imgcourier.online/v1/purge \
  -H "Authorization: Bearer $IC_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prefixes": ["products/summer-26/"]}'

Prefix purges complete in under 15 seconds globally. Each account may run 500 purge requests per hour.

Webhooks

Register an HTTPS endpoint in the dashboard to receive image.created, image.deleted, usage.threshold and source.error events. Every delivery includes an IC-Signature header with a timestamp and an HMAC of the body; reject requests older than five minutes.

Errors & limits

StatusCodeMeaning
400invalid_paramA transformation parameter is out of range. The body names the parameter.
401unauthorizedMissing or revoked API key.
403signature_requiredThe source enforces signing and s is missing or wrong.
404not_foundNo original at that path.
413too_largeInput over 50 MB or 60 megapixels.
422unsupported_inputThe file could not be decoded.
429rate_limitedManagement API limit is 20 req/s per key; see Retry-After.

Delivery requests are not rate-limited. Failed renders return a 1×1 transparent pixel only if you opt in with fallback=pixel; otherwise you get the error status.

SDKs

LanguagePackageVersion
JavaScript / TypeScript@imgcourier/node, @imgcourier/url4.2.0
Pythonimgcourier2.8.1
PHPimgcourier/imgcourier-php1.9.3
Goimgcourier.online/go/imgcourier0.14.0

Something missing or unclear? Email support@imgcourier.online — the docs are maintained by the same engineers who answer support.