Skip to content
smallPict
Start Free

Testing in Sandbox Mode

Use sandbox keys to test conversions without using your quota.

Sandbox mode is meant for local development, CI pipelines, and staging environments.

Requests made in sandbox mode do not count against your monthly quota and do not touch production assets.


Getting sandbox credentials

  1. Go to your SmallPict Dashboard → API Keys.
  2. Click Create Sandbox Key.
  3. Your key will be generated with the sp_test_... prefix (e.g. sp_test_9a8b7c6d5e4f...).
  4. Store the matching secret key somewhere safe.

How sandbox requests are handled

When an API call is made with an sp_test_... key:

End-to-End Image Processing & Edge CDN Flow

Sub-50ms image optimization lifecycle from client upload to global edge delivery.

  1. 01

    Client Application

    WordPress / SDK / API

    Uploads raw image binary with HMAC-SHA256 signature and UUID v4 idempotency key.

    Origin Request

  2. 02

    smallPict Edge CDN

    Global Edge PoPs

    Checks global edge cache. On cache HIT, delivers AVIF/WebP in <20ms worldwide.

    Cache & Delivery

  3. 03

    SmallPict API Gateway

    Authentication & Quotas

    Validates HMAC credentials, verifies quota limits, and scopes access to customer_id.

    Auth & Scoping

  4. 04

    Optimization Engine

    High-Speed Native Encoder

    Multi-threaded quantization transcode to AVIF & WebP with no visible quality loss and much smaller files.

    Transcoding

  5. 05

    Secure Storage & Sync

    Encrypted Cloud Storage

    Stores optimized output, invalidates outdated cache tags, and warms the edge cache.

    Persistent Sync

Zero Data Interception: End-to-end HMAC validation & SHA256 integrity check

Engine: smallPict

  1. No quota usage: Sandbox requests are never deducted from your quota, so tests never use your paid quota.
  2. Temporary storage (24 hours): Converted test images are kept in temporary, encrypted processing storage, isolated from production, and automatically deleted after 24 hours.
  3. Response header: Every response from sandbox requests includes the HTTP header X-SmallPict-Sandbox: true.
  4. File size limit: Sandbox mode permits testing files up to 25MB.

Example usage

Node.js

TypeScript
import { SmallPict } from '@smallpict/sdk';import fs from 'node:fs';
const sandboxClient = new SmallPict({  apiKey: 'sp_test_1234567890abcdef...',  secretKey: 'sec_test_secret123...'});
const result = await sandboxClient.optimize(fs.readFileSync('sample.jpg'), {  format: 'avif',  quality: 80});
console.log('Sandbox conversion succeeded:', result.url);

cURL

Shell
curl -X POST https://api.smallpict.app/v1/optimize \  -H "X-API-Key: sp_test_1234567890abcdef..." \  -H "X-Timestamp: 1716301234" \  -H "X-Signature: 3a9f8b2c4d6e..." \  -H "Content-Type: application/json" \  -d {  "filename": "sample.jpg",  "mime_type": "image/jpeg",  "filesize": 500000,  "options": {    "format": "webp",    "quality": 80  }}'