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
Response headers include rate limit info:
| Header | Description |
|---|---|
X-RateLimit-Limit | Monthly image limit |
X-RateLimit-Remaining | Images remaining this period |
X-RateLimit-Reset | Period reset date (ISO 8601) |
Full document cleanup with 2-pass enhancement. Best for scanned documents, photos of papers, whiteboards.
| Param | Type | Default | Description |
|---|---|---|---|
image | file | required | Image file (JPG, PNG, WebP, TIFF, max 32MB) |
passes | int | 2 | Processing passes (1 or 2). 2 gives best results. |
scales | int | 4 | Detail level (1-12, higher = more detail) |
gamma | float | 1.0 | Gamma correction (0.1-3.0) |
low_input | float | auto | Black point level (0.0-1.0) |
high_input | float | auto | White point level (0.0-1.0) |
p2_scales | int | =scales | Detail level for second pass (passes=2 only) |
p2_gamma | float | =gamma | Gamma for second pass (passes=2 only) |
p2_low_input | float | =low_input | Black point for second pass |
p2_high_input | float | =high_input | White point for second pass |
curl -X POST https://paperclean.ip1.cc/api/v1/clean \ -H "X-API-Key: pc_your_key" \ -F "image=@document.jpg" \ -o cleaned.jpg
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)
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);
Perspective correction crop. Provide 4 corner coordinates (as fractions 0-1) to correct perspective distortion.
| Param | Type | Description |
|---|---|---|
image | file | Image file (required) |
tl_x, tl_y | float | Top-left corner (0-1) |
tr_x, tr_y | float | Top-right corner (0-1) |
br_x, br_y | float | Bottom-right corner (0-1) |
bl_x, bl_y | float | Bottom-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
Full configurable pipeline: optional perspective crop + enhancement. Combine crop and clean in a single request.
| Param | Type | Default | Description |
|---|---|---|---|
image | file | required | Image file |
tl_x...bl_y | float | optional | Crop corners (skip to skip crop) |
passes | int | 2 | Enhancement passes (0=crop only, 1, 2) |
scales | int | 4 | Detail level |
gamma | float | 1.0 | Gamma 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
Check your current usage and limits.
curl https://paperclean.ip1.cc/api/v1/usage \ -H "X-API-Key: pc_your_key"
{
"data": {
"plan": "free",
"limit": 50,
"used": 12,
"remaining": 38,
"period_end": "2026-04-26T00:00:00Z"
}
}
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"}'
{
"data": {
"api_key": "pc_abc123...",
"email": "you@example.com",
"plan": "free",
"limit": 50,
"message": "API key created! You have 50 free images per month."
}
}
Image endpoints return the processed image directly as image/jpeg.
JSON endpoints return:
{"data": {...}} // Success
{"error": "message"} // Error
| Code | Meaning |
|---|---|
| 400 | Bad request (missing params, invalid format) |
| 401 | Missing or invalid API key |
| 403 | API key inactive |
| 405 | Wrong HTTP method |
| 429 | Rate limit exceeded |
| 500 | Server error (processing failed) |