Flip the entire page order of a document — handy for back-to-front scans.
At a glance
Section titled “At a glance”| MCP tool | reverse_pages |
| HTTP endpoint | POST /v1/pages/reverse |
| Price | $0.05 |
| Input | One PDF |
| Output | The same PDF with pages in reverse order |
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
file |
file | yes | Source PDF. |
MCP example
Section titled “MCP example”Reverse the page order of
https://example.com/scanned-backwards.pdf.
{ "file": "https://example.com/scanned-backwards.pdf"}HTTP example
Section titled “HTTP example”curl -i -X POST https://api.pdfasyougo.com/v1/pages/reverse \ -H "Content-Type: application/json" \ -H "X-PAYMENT: <base64-encoded-payment-payload>" \ -d '{"file":"https://example.com/scanned-backwards.pdf"}'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/reverse', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file: 'https://example.com/scanned-backwards.pdf' }),});console.log((await res.json()).output.url);Response
Section titled “Response”{ "output": { "url": "https://files.pdfasyougo.com/o/5e1b…?token=…", "expires_at": "2026-06-29T12:00:00Z", "pages": 12, "bytes": 98304 }, "operation": "pages.reverse", "cost": "0.05 USDC"}- The whole document is reversed; there are no parameters to select a subset.
- Page content and rotation are preserved — only the order changes.