PaperClean API

Document image cleanup and enhancement

Home Try it (Swagger) Postman Collection Get API Key

Authentication

Include your API key in every request:

X-API-Key: pc_your_api_key_here

Or as a query parameter: ?api_key=pc_your_api_key_here

Rate Limits

Response headers include rate limit info:

HeaderDescription
X-RateLimit-LimitMonthly image limit
X-RateLimit-RemainingImages remaining this period
X-RateLimit-ResetPeriod reset date (ISO 8601)

Free

$0
50 images/month

Starter

$9/mo
$5/mo
Launch Price
500 images/month

Pro

$29/mo
$20/mo
Launch Price
5,000 images/month

Enterprise

$99/mo
Unlimited

Endpoints

POST/api/v1/clean

Full document cleanup with 2-pass enhancement. Best for scanned documents, photos of papers, whiteboards.

Parameters (multipart/form-data)

ParamTypeDefaultDescription
imagefilerequiredImage file (JPG, PNG, WebP, TIFF, max 32MB)
passesint2Processing passes (1 or 2). 2 gives best results.
scalesint4Detail level (1-12, higher = more detail)
gammafloat1.0Gamma correction (0.1-3.0)
low_inputfloatautoBlack point level (0.0-1.0)
high_inputfloatautoWhite point level (0.0-1.0)
p2_scalesint=scalesDetail level for second pass (passes=2 only)
p2_gammafloat=gammaGamma for second pass (passes=2 only)
p2_low_inputfloat=low_inputBlack point for second pass
p2_high_inputfloat=high_inputWhite point for second pass

Example (curl)

curl -X POST https://paperclean.ip1.cc/api/v1/clean \
  -H "X-API-Key: pc_your_key" \
  -F "image=@document.jpg" \
  -o cleaned.jpg

Example (Python)

import requests

resp = requests.post(
    "https://paperclean.ip1.cc/api/v1/clean",
    headers={"X-API-Key": "pc_your_key"},
    files={"image": open("document.jpg", "rb")}
)
with open("cleaned.jpg", "wb") as f:
    f.write(resp.content)

Example (Node.js)

const fs = require('fs');
const FormData = require('form-data');
const axios = require('axios');

const form = new FormData();
form.append('image', fs.createReadStream('document.jpg'));

const resp = await axios.post(
  'https://paperclean.ip1.cc/api/v1/clean',
  form,
  { headers: { 'X-API-Key': 'pc_your_key', ...form.getHeaders() },
    responseType: 'arraybuffer' }
);
fs.writeFileSync('cleaned.jpg', resp.data);
POST/api/v1/crop

Perspective correction crop. Provide 4 corner coordinates (as fractions 0-1) to correct perspective distortion.

ParamTypeDescription
imagefileImage file (required)
tl_x, tl_yfloatTop-left corner (0-1)
tr_x, tr_yfloatTop-right corner (0-1)
br_x, br_yfloatBottom-right corner (0-1)
bl_x, bl_yfloatBottom-left corner (0-1)
curl -X POST https://paperclean.ip1.cc/api/v1/crop \
  -H "X-API-Key: pc_your_key" \
  -F "image=@photo.jpg" \
  -F "tl_x=0.05" -F "tl_y=0.03" \
  -F "tr_x=0.95" -F "tr_y=0.02" \
  -F "br_x=0.97" -F "br_y=0.98" \
  -F "bl_x=0.04" -F "bl_y=0.97" \
  -o cropped.jpg
POST/api/v1/pipeline

Full configurable pipeline: optional perspective crop + enhancement. Combine crop and clean in a single request.

ParamTypeDefaultDescription
imagefilerequiredImage file
tl_x...bl_yfloatoptionalCrop corners (skip to skip crop)
passesint2Enhancement passes (0=crop only, 1, 2)
scalesint4Detail level
gammafloat1.0Gamma correction
curl -X POST https://paperclean.ip1.cc/api/v1/pipeline \
  -H "X-API-Key: pc_your_key" \
  -F "image=@photo.jpg" \
  -F "tl_x=0.05" -F "tl_y=0.03" \
  -F "tr_x=0.95" -F "tr_y=0.02" \
  -F "br_x=0.97" -F "br_y=0.98" \
  -F "bl_x=0.04" -F "bl_y=0.97" \
  -F "passes=2" -F "scales=6" \
  -o result.jpg
GET/api/v1/usage

Check your current usage and limits.

curl https://paperclean.ip1.cc/api/v1/usage \
  -H "X-API-Key: pc_your_key"

Response

{
  "data": {
    "plan": "free",
    "limit": 50,
    "used": 12,
    "remaining": 38,
    "period_end": "2026-04-26T00:00:00Z"
  }
}
POST/api/v1/register

Register for a free API key. No authentication required.

curl -X POST https://paperclean.ip1.cc/api/v1/register \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'

Response

{
  "data": {
    "api_key": "pc_abc123...",
    "email": "you@example.com",
    "plan": "free",
    "limit": 50,
    "message": "API key created! You have 50 free images per month."
  }
}

Response Format

Image endpoints return the processed image directly as image/jpeg.

JSON endpoints return:

{"data": {...}}           // Success
{"error": "message"}      // Error

Error Codes

CodeMeaning
400Bad request (missing params, invalid format)
401Missing or invalid API key
403API key inactive
405Wrong HTTP method
429Rate limit exceeded
500Server error (processing failed)