Guide
Everything you need to get started with PixCrush — from the web UI to the API, CLI, and AI agent integration.
Introduction
PixCrush is a fast, developer-friendly image compression and processing API. Built on Sharp, it supports JPEG, PNG, WebP, AVIF, GIF, and SVG. Use it via the REST API, CLI, or integrate it into your AI agent workflows.
Whether you're optimizing images for a website, building a media pipeline, or letting an LLM handle image processing on your behalf, PixCrush has you covered.
Features Overview
Compression
JPEG, PNG, WebP, AVIF, GIF, and SVG — all optimized with best-in-class algorithms and tunable quality.
Resize
Resize images with fit modes: cover, contain, fill, inside, and outside. Dimensions from 1 to 10,000 pixels.
Batch Processing
Process up to 10 images per request. Upload once, get all results back when ready.
Webhooks
Get notified on job completion via webhooks. Retries with exponential backoff built in.
API Key Management
Create, rotate, and revoke API keys from the developer portal. Keys start with pk_live_.
Job Queue
Redis-backed Horizon job queue for reliable, scalable processing. Sentry monitoring included.
API Usage
Authentication
All API requests use Basic Auth. Use api as the username and your API key (starts with pk_live_) as the password.
Base URL: https://api.pixcrush.dev
OpenAPI Docs: https://api.pixcrush.dev/docs/api
Compress an Image
POST /api/v1/shrink
curl -X POST https://api.pixcrush.dev/api/v1/shrink \
-u api:pk_live_YOUR_KEY \
-F "file=@image.jpg" \
-F "quality=80"Resize an Image
POST /api/v1/resize
curl -X POST https://api.pixcrush.dev/api/v1/resize \
-u api:pk_live_YOUR_KEY \
-F "file=@image.jpg" \
-F "width=800" \
-F "height=600" \
-F "fit=cover"Batch Processing
POST /api/v1/batch
curl -X POST https://api.pixcrush.dev/api/v1/batch \
-u api:pk_live_YOUR_KEY \
-F "files[]=@image1.jpg" \
-F "files[]=@image2.png" \
-F "files[]=@image3.webp" \
-F "quality=75"Check Job Status
GET /api/v1/jobs/{id}
curl https://api.pixcrush.dev/api/v1/jobs/abc123 \
-u api:pk_live_YOUR_KEYDownload Result
GET /api/v1/output/{id}
curl -OJ https://api.pixcrush.dev/api/v1/output/abc123 \
-u api:pk_live_YOUR_KEYCLI Install Guide
The PixCrush CLI lets you compress and resize images directly from your terminal.
Installation
# Install globally with npm
npm install -g @yabasha/pixcrush
# or with bun
bun add -g @yabasha/pixcrushAuthentication
# Set your API key
pixcrush config set apiKey <your-api-key>Usage
# Compress a single image
pixcrush compress image.jpg
# Compress all images in a folder
pixcrush compress ./images/ --output ./compressed/
# View image info
pixcrush info image.jpgLLM / AI Agent Integration
PixCrush exposes a full OpenAPI spec that AI agents and LLMs can use to compress, resize, and process images programmatically. Agents must obtain an API key from the developer portal.
Base URL: https://api.pixcrush.dev
Auth: Basic <base64(api:pk_live_YOUR_KEY)>
Example System Prompt for LLMs
You have access to the PixCrush image processing API.
Base URL: https://api.pixcrush.dev
Authentication: Basic Auth with "api" as username, your API key as password.
Available operations:
- Compress: POST /api/v1/shrink
- Resize: POST /api/v1/resize
- Batch: POST /api/v1/batch
Full documentation: https://api.pixcrush.dev/docs/apiGeneral Guidelines
- •API keys start with
pk_live_— keep them secret. - •Rotate keys via
POST /api/v1/keys/{id}/rotateif compromised. - •Webhooks retry 3 times with exponential backoff (5s → 30s → 120s).
- •Batch requests: max 10 images, each under the size limit.
- •Resize dimensions: 1–10,000 pixels per side.
- •SVG inputs are sanitized for XSS safety.
- •Rate limits apply per API key.
- •Job results are available for 24 hours via the download URL.