Basic
Free
- 10 free requests/month (Hard limit)
- 5 MB max file size
- 3 steps per request
- JPEG, PNG, GIF, WEBP
- PDF rendering
Chain thumbnail, resize, rotate, crop, flip, and watermark operations in a single REST call. Supports JPEG, PNG, GIF, WEBP, and multi-page PDFs.
curl -X POST \
https://api.example.com/process \
-H "X-RapidAPI-Key: YOUR_KEY" \
-F "file=@photo.jpg" \
-F 'steps=[
{"op":"rotate","args":[15]},
{"op":"thumbnail","args":[800]}
]' \
-F "format=JPEG" \
--output result.jpg
A pipeline-based approach lets you compose multiple transforms in one round-trip.
/process call. No server-side storage — your image is processed and returned immediately./validate endpoint.Get a processed image in under a minute.
Subscribe on RapidAPI and copy your X-RapidAPI-Key.
curl -X POST \
https://api.example.com/process \
-H "X-RapidAPI-Key: YOUR_KEY" \
-F "file=@photo.jpg" \
-F 'steps=[
{"op": "rotate", "args": [90]},
{"op": "thumbnail", "args": [400]}
]' \
-F "format=JPEG" \
--output out.jpg
import requests
resp = requests.post(
"https://api.example.com/process",
headers={"X-RapidAPI-Key": "YOUR_KEY"},
files={"file": open("photo.jpg", "rb")},
data={
"steps": '[{"op":"rotate","args":[90]},{"op":"thumbnail","args":[400]}]',
"format": "JPEG",
},
)
with open("out.jpg", "wb") as f:
f.write(resp.content)
const form = new FormData();
form.append("file", fileInput.files[0]);
form.append("steps", JSON.stringify([
{ op: "rotate", args: [90] },
{ op: "thumbnail", args: [400] },
]));
form.append("format", "JPEG");
const resp = await fetch("https://api.example.com/process", {
method: "POST",
headers: { "X-RapidAPI-Key": "YOUR_KEY" },
body: form,
});
const blob = await resp.blob(); // image bytes
All plans enforced via RapidAPI gateway.
Free
$5/mo + $0.07/req
All requests must include your RapidAPI key and subscription tier in the request headers:
| Header | Required | Description |
|---|---|---|
X-RapidAPI-Key | Yes | Your RapidAPI API key |
X-RapidAPI-Subscription | No | Plan tier: BASIC (default) or PRO |
X-RapidAPI-Proxy-Secret | No | Injected automatically by the RapidAPI gateway — do not set manually |
/process
Upload an image or PDF and apply pipeline steps in a single request. The image is processed in-memory and returned immediately — nothing is stored on the server.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
file | File | Yes | — | JPEG, PNG, GIF, WEBP, or PDF |
steps | string | Yes | — | JSON-encoded array of step objects |
format | string | No | JPEG | Output format: JPEG, PNG, WEBP, GIF |
page | integer | No | 0 | PDF only. 0-indexed page number. |
dpi | integer | No | 150 | PDF only. Render DPI. |
curl -X POST https://api.example.com/process \
-H "X-RapidAPI-Key: YOUR_KEY" \
-F "file=@photo.jpg" \
-F 'steps=[{"op":"cropULWH","args":[0,0,400,300]},{"op":"thumbnail","args":[200]}]' \
-F "format=PNG" \
--output cropped.png
| Status | Condition |
|---|---|
400 | Invalid file type, malformed steps JSON, or unknown operation |
403 | Step count exceeds plan limit |
413 | File exceeds plan size limit |
/validate
Dry-run validation. Checks that all operations exist and arguments are well-formed without executing the pipeline or requiring an image.
| Field | Type | Required | Description |
|---|---|---|---|
steps | array | Yes | List of step objects to validate |
{ "valid": true, "steps": 2 }
{
"detail": [
{ "step": 0, "op": "bad_op", "error": "Unknown operation: 'bad_op'" }
]
}
/operations
List all available registered operations with their descriptions.
[
{ "name": "thumbnail", "description": "Create a thumbnail..." },
{ "name": "resize", "description": "Resize the image..." },
// ...
]
/hex_to_rgb
Utility: convert a hex color string to an RGB array usable in operation arguments like fillcolor.
| Parameter | Type | Required | Description |
|---|---|---|---|
hex_color | string | Yes | Hex color, e.g. #FF5733 or FF5733 |
{ "rgb": [255, 87, 51] }
| Status | Condition |
|---|---|
400 | Invalid hex color format |
All operations are passed as objects in the steps array with op, args, and/or kwargs fields.
thumbnail
Resize
Fit the image within a square of max_dimension × max_dimension pixels, preserving aspect ratio using high-quality Lanczos resampling. The image is modified in-place (never enlarged).
| Argument | Type | Position | Description |
|---|---|---|---|
max_dimension | int | args[0] | Maximum width or height in pixels |
{ "op": "thumbnail", "args": [400] }
resize
Resize
Resize to exact pixel dimensions. Does not preserve aspect ratio.
| Argument | Type | Position | Description |
|---|---|---|---|
width | int | args[0] | Target width in pixels |
height | int | args[1] | Target height in pixels |
{ "op": "resize", "args": [1280, 720] }
rotate
Transform
Rotate the image counter-clockwise by the given angle. Background fill color is applied to corners exposed by rotation.
| Argument | Type | Position / Key | Default | Description |
|---|---|---|---|---|
angle | float | args[0] | — | Degrees to rotate (counter-clockwise) |
expand | bool | kwargs | true | Expand canvas to fit rotated image |
fillcolor | [R,G,B] or [R,G,B,A] | kwargs | [0,0,0,0] | Color to fill exposed corners |
{ "op": "rotate", "args": [45], "kwargs": { "fillcolor": [255, 255, 255] } }
cropLTRB
Crop
Crop using absolute pixel coordinates: left, top, right, bottom.
| Argument | Type | Position | Description |
|---|---|---|---|
left | int | args[0] | Left edge (pixels from left) |
top | int | args[1] | Top edge (pixels from top) |
right | int | args[2] | Right edge (pixels from left) |
bottom | int | args[3] | Bottom edge (pixels from top) |
{ "op": "cropLTRB", "args": [100, 50, 500, 400] }
cropULWH
Crop
Crop using upper-left origin with explicit width and height.
| Argument | Type | Position | Description |
|---|---|---|---|
x | int | args[0] | Upper-left x coordinate |
y | int | args[1] | Upper-left y coordinate |
width | int | args[2] | Width of the crop region |
height | int | args[3] | Height of the crop region |
{ "op": "cropULWH", "args": [0, 0, 400, 300] }
flip
Transform
Mirror the image horizontally or vertically.
| Argument | Type | Position | Values |
|---|---|---|---|
direction | string | args[0] | "horizontal" or "vertical" |
{ "op": "flip", "args": ["horizontal"] }
fill_background_color
Compositing
Flatten a transparent (RGBA) image onto a solid color background. Useful before converting to JPEG which has no alpha channel.
| Argument | Type | Position | Description |
|---|---|---|---|
color | [R,G,B] | args[0] | Background color as an RGB array |
{ "op": "fill_background_color", "args": [[255, 255, 255]] }
| Status | Meaning |
|---|---|
400 Bad Request | Invalid file type, malformed JSON steps, unknown operation, or bad arguments |
403 Forbidden | Request didn't come through RapidAPI gateway, or step count exceeds plan limit |
413 Payload Too Large | Uploaded file exceeds the plan's maximum file size |
422 Unprocessable | Operation failed at runtime (e.g. incompatible image state) |
All error responses return JSON with a detail field:
{ "detail": "File too large. Max size for your tier: 5MB" }