Produce a new PDF with the selected pages deleted and the rest kept in order.
At a glance
Section titled “At a glance”| MCP tool | remove_pages |
| HTTP endpoint | POST /v1/pages/remove |
| Price | $0.05 |
| Input | One PDF + a page range |
| Output | A PDF without the selected pages |
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
file |
file | yes | Source PDF. |
pages |
page range | yes | Pages to delete, e.g. 2,4-6. 1-indexed. |
MCP example
Section titled “MCP example”Remove pages 2 and 4 through 6 from
https://example.com/report.pdf.
{ "file": "https://example.com/report.pdf", "pages": "2,4-6"}HTTP example
Section titled “HTTP example”curl -i -X POST https://api.pdfasyougo.com/v1/pages/remove \ -H "Content-Type: application/json" \ -H "X-PAYMENT: <base64-encoded-payment-payload>" \ -d '{"file":"https://example.com/report.pdf","pages":"2,4-6"}'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/pages/remove', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file: 'https://example.com/report.pdf', pages: '2,4-6' }),});console.log((await res.json()).output.url);Response
Section titled “Response”{ "output": { "url": "https://files.pdfasyougo.com/o/9d4e…?token=…", "expires_at": "2026-06-29T12:00:00Z", "pages": 6, "bytes": 61440 }, "operation": "pages.remove", "cost": "0.05 USDC"}- Pages are 1-indexed; see the page-range syntax.
- Remaining pages keep their original relative order.
- Removing every page is rejected as a
processing_error(the result would be empty) and isn’t charged.