Base URL
https://unlockpdf.dev
Authentication
x402 Protocol
No API keys required. The first 10 requests per IP per day are free. After that, each request costs $0.05 USDC via the x402 payment protocol on Base network.
1
Send request — POST to /api/unlock with your PDF
2
Receive 402 — if free tier is used up, server returns HTTP 402 with payment details in the
X-Payment-Required header3
Pay $0.05 USDC on Base network to
0x59387E...734F4
Retry with payment — include
X-Payment: <signed_payload> header5
Receive unlocked PDF — binary response
GET
/api/info
Check your current usage and payment details. Useful for AI agents to discover pricing before uploading.
Response
// 200 OK
{
"service": "UnlockPDF.dev",
"free_tier": {
"limit": 10,
"remaining_today": 7
},
"paid_tier": {
"price": "0.05 USDC",
"network": "base-mainnet",
"pay_to": "0x59387E6869A12d76f321Ea609de4e073284F734F",
"protocol": "x402"
}
}
POST
/api/unlock
Remove password protection from a PDF file. Returns the unlocked PDF as a binary download.
Request Parameters Example — Free Tier
cURL
curl -X POST https://unlockpdf.dev/api/unlock \
-F "[email protected]" \
-F "password=mysecretpassword" \
--output unlocked.pdf
Example — With x402 Payment
cURL
# Include signed payment payload after paying $0.05 USDC
curl -X POST https://unlockpdf.dev/api/unlock \
-H "X-Payment: <base64_signed_payload>" \
-F "[email protected]" \
--output unlocked.pdf
Example — Python
Python
import requests
# Free tier — no payment needed
with open("document.pdf", "rb") as f:
response = requests.post(
"https://unlockpdf.dev/api/unlock",
files={"pdf_file": f},
data={"password": "optional_password"}
)
if response.status_code == 200:
with open("unlocked.pdf", "wb") as out:
out.write(response.content)
elif response.status_code == 402:
# Free tier used up — handle x402 payment
payment_info = response.json()
print(f"Pay {payment_info['amount']} USDC to {payment_info['payTo']}")
Responses
GET
/api/health
Service health check. Returns 200 if the API is running.
Response
{ "status": "ok", "service": "UnlockPDF", "version": "1.0.0" }