Quick Start

Get up and running with Image Processing Toolkit API in under a minute.

1. Get your API key

Sign up on RapidAPI to get your free API key. The Basic plan includes generous rate limits at no cost.

2. Encode your image

All images are sent as Base64-encoded strings in the JSON request body. There are no multipart uploads.

# Encode a file to base64 (Linux/macOS)
base64 -i photo.jpg
import base64

with open("photo.jpg", "rb") as f:
    b64 = base64.b64encode(f.read()).decode()

print(b64[:80] + "...")
const fs = require("fs");
const b64 = fs.readFileSync("photo.jpg").toString("base64");
console.log(b64.slice(0, 80) + "...");

3. Make your first request

curl -X POST "https://image.toolkitapi.io/v1/image/resize" \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image": "BASE64_HERE", "width": 800, "maintain_aspect": true}'
import httpx, base64

with open("photo.jpg", "rb") as f:
    b64 = base64.b64encode(f.read()).decode()

resp = httpx.post(
    "https://image.toolkitapi.io/v1/image/resize",
    headers={"X-API-Key": "YOUR_KEY"},
    json={"image": b64, "width": 800, "maintain_aspect": True},
)
result = resp.json()
print(result["width"], "x", result["height"])
const fs = require("fs");
const b64 = fs.readFileSync("photo.jpg").toString("base64");

const resp = await fetch("https://image.toolkitapi.io/v1/image/resize", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": "YOUR_KEY",
  },
  body: JSON.stringify({ image: b64, width: 800, maintain_aspect: true }),
});
const data = await resp.json();
console.log(data.width, "x", data.height);

4. Decode the response

The response contains a image field with the processed image as a Base64 string. Decode it to get the raw bytes.

# The response image field is base64 — decode with jq + base64
curl ... | jq -r .image | base64 --decode > output.jpg
import base64

result = resp.json()
img_bytes = base64.b64decode(result["image"])
with open("output.jpg", "wb") as f:
    f.write(img_bytes)
const data = await resp.json();
const buf = Buffer.from(data.image, "base64");
fs.writeFileSync("output.jpg", buf);

5. Explore all endpoints

Browse the full tool listing to find the endpoint you need. Every endpoint accepts the same Base64 pattern.