PurifyAI

Quickstart

From nothing to a scrubbed file in three steps.

1. Create an API key

Open API keys in your workspace, name the key after the thing that will use it, and press Create key.

The key is shown exactly onceOnly a hash is stored, so it cannot be shown again — not by the dashboard, and not by support. If you lose it, rotate the key and update whatever was using it.

2. Send a file

The endpoint takes multipart/form-data with a file field. The response body is the cleaned file itself, so write it straight to disk.

Scrub a file
curl -X POST "https://www.purifyai.app/api/v1/scrub" \
-H "Authorization: Bearer $PURIFYAI_KEY" \
-F "file=@photo.png" \
-F "mode=all" \
-D headers.txt \
-o photo_clean.png
# The report is in the response headers
grep -i "X-PurifyAI" headers.txt
Read the key from the environmentEvery sample reads PURIFYAI_KEY rather than embedding the key inline. A key pasted into source is a key that ends up in version control, and rotating it then means touching every place it was copied to.

3. Read the report

A successful response body is binary, so the report travels in headers rather than JSON:

response headers
HTTP/1.1 200 OK
Content-Type: image/png
Content-Disposition: attachment; filename="photo_scrubbed.png"
X-PurifyAI-Tags-Removed: 4
X-PurifyAI-Format: png
X-PurifyAI-Bytes-Saved: 18244
X-PurifyAI-Usage-Count: 12
X-RateLimit-Remaining: 118

X-PurifyAI-Tags-Removed: 0 is a success, not a failure — it means the file carried nothing to strip.

Next

PreviousOverviewNext Authentication