What is OptStuff?
OptStuff is a secure image optimization API that resizes, compresses, and converts images on-the-fly with signed URL security and multi-tenant support.
OptStuff is a secure, high-performance image optimization API designed for developers and teams who need to deliver optimized images at scale with fine-grained access control.
Point your image URLs through OptStuff's API endpoint, and it delivers optimized images with the right format, size, and quality — all controlled via URL parameters.
Quick Example
Turn any image into an optimized, resized WebP — with one signed URL.
Assume your OptStuff deployment is https://images.example.com and your project slug is my-blog:
GET https://images.example.com/api/v1/my-blog/w_800,q_80,f_webp/cdn.example.com/photo.jpg?key=pk_...&sig=...&exp=<future-unix-timestamp>In this URL:
https://images.example.comis your OptStuff deployment endpointmy-blogis your project slugcdn.example.com/photo.jpgis the source image URL without protocol
Generate it server-side in a few lines:
import { generateOptStuffUrl } from "@/lib/optstuff-core";
const url = generateOptStuffUrl(
"https://cdn.example.com/photo.jpg",
{ width: 800, quality: 80, format: "webp" },
86400,
);Key Features
- On-the-fly Optimization — Resize, format conversion (WebP, AVIF), and quality adjustment via URL parameters
- Signed URL Security — HMAC-SHA256 signatures prevent unauthorized access
- Multi-tenant Architecture — Teams → Projects → API Keys hierarchy
- Domain Whitelisting — Control allowed image sources and referer domains
- Encrypted Key Storage — AES-256-GCM encryption for API keys at rest
- Rate Limiting — Configurable per-minute and per-day limits per API key
- Usage Analytics — Request logs, bandwidth tracking, and top images statistics
How It Works
- Create a Project — Set up a project in the dashboard
- Generate an API Key — Get your public/secret key pair
- Sign URLs — Use the secret key to sign image request URLs server-side
- Make Requests — Send signed requests to the OptStuff API
- Get Optimized Images — Receive optimized images with caching headers
Use Cases
| Scenario | How OptStuff Helps |
|---|---|
| Web Applications | Serve appropriately sized images for different screens; convert to modern formats (WebP, AVIF) |
| Content Delivery | Integrate with your CDN for edge-cached, optimized images |
| E-commerce | Thumbnail generation, zoom-ready images, consistent catalog dimensions |
| User-Generated Content | Resize, compress, and convert user uploads to web-friendly formats |
Technical Specifications
| Specification | Details |
|---|---|
| Encryption | AES-256-GCM with HKDF key derivation |
| Signing | HMAC-SHA256 |
| Image Engine | IPX (powered by Sharp) |
| Supported Input Formats | JPEG, PNG, WebP, AVIF, GIF |
| Supported Output Formats | JPEG, PNG, WebP, AVIF |
| Caching | Aggressive cache headers for CDN compatibility |
Pricing
OptStuff is designed to run on serverless infrastructure at minimal cost. For a full breakdown of the per-request cost structure and pricing strategy, see Cost Analysis & Pricing Strategy.
Explore the Docs
Core Concepts
Teams, Projects, API Keys, signed URLs, and the permission model.
Quick Start
Get your first optimized image in under 5 minutes.
Next.js Integration
Add OptStuff to your Next.js application with Server Components, API Routes, and the next/image loader.
API Reference
Endpoint format, image operations, and error codes.
Usage Metrics Calculations
Exact calculation formulas, data sources, and sampling caveats for dashboard analytics.
Code Examples
URL signing in Node.js, Python, Go, Ruby, and PHP.
Self-Hosting
Deploy your own OptStuff instance on Vercel.
Cost Analysis
Per-request cost breakdown and pricing strategy for your SaaS.
Last updated on