ohmywrap
Get an API key

§ Mark and adjust

Optimize PDF API

Rewrites the file, dropping duplicated and orphaned objects. This is structural housekeeping rather than image downsampling, so expect a smaller file without any change to how a page looks.

Endpoint
POST /pdf/optimize
Inputs
Exactly 1 PDF
Returns
application/pdf
Limits
20 MB per file, 3,000 pages.
Price
$0.001

§ 01 The request

One POST, and the file comes back.

POST /pdf/optimize
curl -sS --fail-with-body \
  -o optimized.pdf \
  -H "Authorization: Bearer $OHMYWRAP_KEY" \
  -F "file=@bloated.pdf" \
  https://api.ohmywrap.com/pdf/optimize

Options

None. Send the file and nothing else. An options object is still accepted, but any key inside it is 422 invalid_options.

Worth knowing

It does not re-encode images or downsample them. If a file is large because of its pictures, optimize will not be the answer.

Your first /pdf/optimize call takes one line of curl.

Ten thousand calls cost ten dollars, the pack never expires, and nothing you send is kept.

10,000 calls for $10. No subscription, no expiry.