§ Chain
Image Pipeline API
The endpoint that pays for libvips. The same chain across single endpoints would decode and re-encode at every hop, which on a large photo costs more than all the transforms together. Chainable steps: resize, crop, rotate, composite.
- Endpoint
- POST /image/pipeline
- Inputs
- Exactly 1 image
- Aux part
- overlay — one image, for a `composite` step
- Returns
- The encoded image
- Limits
- 8 steps, 20 MB per file, 50 M pixels in, 50 M pixels out.
- Price
- $0.001
§ 01 The request
One POST, and the file comes back.
POST /image/pipeline
curl -sS --fail-with-body \
-o hero.webp \
-H "Authorization: Bearer $OHMYWRAP_KEY" \
-F "file=@photo.jpg" \
-F "overlay=@logo.png" \
-F 'options={"steps":[{"op":"resize","options":{"width":1200,"height":600,"fit":"cover"}},{"op":"composite","options":{"gravity":"southeast","opacity":0.5}}],"output":{"format":"webp","quality":80}}' \
https://api.ohmywrap.com/image/pipelineOptions
| Option | Type | Default | What it does |
|---|---|---|---|
| stepsrequired | object[] | — | 1 to 8 steps, applied in order. |
| steps[].oprequired | string | — | `resize`, `crop`, `rotate`, or `composite`. |
| steps[].options | object | — | That endpoint’s options, minus `output`, `animated`, and `autoOrient`, which belong to the pipeline as a whole. |
| output | object | — | The shared encode block: format, quality, lossless, effort, progressive, keepMetadata. |
Worth knowing
A failing step names which one it was and keeps the underlying error’s own code, so a bad crop in step 2 is invalid_crop, not a generic pipeline error.
Your first /image/pipeline 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.