Skip to content

Merge documents

Combine multiple PDFs into a single document. MCP tool merge_pdfs / HTTP POST /v1/merge.

Combine multiple PDFs into one, in the order you provide them.

MCP tool merge_pdfs
HTTP endpoint POST /v1/merge
Price $0.05
Input An ordered list of PDFs
Output A single merged PDF (download URL)
Parameter Type Required Description
files array of files yes Two or more source PDFs, merged in array order. Each item may be a URL, an upload, or (small) base64.

Merge https://example.com/q3-part1.pdf and https://example.com/q3-part2.pdf into one file.

The agent calls merge_pdfs with:

{
"files": [
"https://example.com/q3-part1.pdf",
"https://example.com/q3-part2.pdf"
]
}
Terminal window
# 1) Unpaid request → 402 with payment requirements
curl -i -X POST https://api.pdfasyougo.com/v1/merge \
-H "Content-Type: application/json" \
-d '{"files":["https://example.com/q3-part1.pdf","https://example.com/q3-part2.pdf"]}'
# 2) Retry with a signed payment payload
curl -i -X POST https://api.pdfasyougo.com/v1/merge \
-H "Content-Type: application/json" \
-H "X-PAYMENT: <base64-encoded-payment-payload>" \
-d '{"files":["https://example.com/q3-part1.pdf","https://example.com/q3-part2.pdf"]}'
{
"output": {
"url": "https://files.pdfasyougo.com/o/3f9a…?token=…",
"expires_at": "2026-06-29T12:00:00Z",
"pages": 24,
"bytes": 184320
},
"operation": "merge",
"cost": "0.05 USDC"
}
  • Order is preserved — files are concatenated in the order of the files array.
  • You can mix input forms in one call (e.g. one URL and one upload). See File handling.
  • Provide at least two files; a single file returns a validation_error.