Decrypt a password-protected PDF you have the password for. MCP tool remove_password / HTTP POST /v1/password/remove.
Remove the open password from a PDF, given the current password, producing an unencrypted file.
At a glance
Section titled “At a glance”| MCP tool | remove_password |
| HTTP endpoint | POST /v1/password/remove |
| Price | $0.05 |
| Input | One encrypted PDF + its current password |
| Output | The same PDF, decrypted |
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
file |
file | yes | The encrypted source PDF. |
password |
string | yes | The current open password. |
MCP example
Section titled “MCP example”Remove the password from
https://example.com/protected.pdf— the password iss3cret.
{ "file": "https://example.com/protected.pdf", "password": "s3cret"}HTTP example
Section titled “HTTP example”curl -i -X POST https://api.pdfasyougo.com/v1/password/remove \ -H "Content-Type: application/json" \ -H "X-PAYMENT: <base64-encoded-payment-payload>" \ -d '{"file":"https://example.com/protected.pdf","password":"s3cret"}'import { wrapFetchWithPayment } from 'x402-fetch';import { privateKeyToAccount } from 'viem/accounts';
const account = privateKeyToAccount(process.env.X402_WALLET_PRIVATE_KEY as `0x${string}`);const fetchWithPay = wrapFetchWithPayment(fetch, account);
const res = await fetchWithPay('https://api.pdfasyougo.com/v1/password/remove', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file: 'https://example.com/protected.pdf', password: 's3cret' }),});console.log((await res.json()).output.url);Response
Section titled “Response”{ "output": { "url": "https://files.pdfasyougo.com/o/d92a…?token=…", "expires_at": "2026-06-29T12:00:00Z", "pages": 8, "bytes": 71680 }, "operation": "password.remove", "cost": "0.05 USDC"}- You must supply the correct current password. A wrong password returns a
processing_error(422) and isn’t charged. - This removes the open password. To clear permission-based restrictions, use Remove restrictions.
- The supplied password is used only to decrypt and is not retained.