Media

Image Processing API

Powerful image manipulation pipeline powered by sharp. Chain up to 10 operations including resize, crop, rotate, flip, grayscale, blur, sharpen, and compress. Supports JPEG, PNG, WebP, and AVIF output formats.

Endpoint:/api/v1/image/process
Method:POST
Latency:~200ms

Try it out

POST/api/v1/image/process

Parameters

Code

curl
curl -X POST "https://khaleejiapi.dev/api/v1/image/process?url=https%3A%2F%2Fpicsum.photos%2F800%2F600&outputFormat=jpeg" \
-H "Authorization: Bearer your_api_key"

Request Body

FieldTypeRequiredDescription
urlstringRequiredHTTPS URL of source image (max 10 MB)
operationsarrayRequiredArray of operations (max 10)
outputFormatstringOptionaljpeg, png, webp, or avif (default: jpeg)

Available Operations

resize

Resize image. Params: width (1–8192), height (1–8192) — at least one required

crop

Crop image. Params: width, height (required), x, y (optional offset)

rotate

Rotate image. Params: angle (0–360 degrees)

flip

Flip image. Params: direction ('horizontal' or 'vertical')

grayscale

Convert to grayscale. No additional parameters

blur

Apply Gaussian blur. Params: sigma (0.3–100)

sharpen

Sharpen image. No additional parameters

compress

Compress image. Params: quality (1–100)

Response

Returns the processed image as a binary response with informational headers:

Content-Type — MIME type of the output image
X-Original-Size — Original image size in bytes
X-Processed-Size — Processed image size in bytes
X-Operations — Comma-separated list of applied operations

Rate Limits

PlanRequests/MonthRate Limit
Free5005 req/min
Starter5,00030 req/min
Professional50,000120 req/min
Business250,000500 req/min

Debugging & Support

Include X-Request-ID when contacting support

Every response from KhaleejiAPI includes an X-Request-ID header — a unique identifier that lets our support team pull the exact log entry for your request within seconds. Always share it when reporting an unexpected error or unexpected result.

How to capture it

JavaScript / fetch

const res = await fetch("https://khaleejiapi.dev/api/v1/...", {
  headers: { Authorization: "******" },
});
const requestId = res.headers.get("x-request-id");
console.log("Request ID:", requestId);
// → e.g. "req_01j9xkz4vp8..."

cURL

curl -si "https://khaleejiapi.dev/api/v1/..." \
  -H "Authorization: ******" | grep -i x-request-id
# → x-request-id: req_01j9xkz4vp8...

Browser DevTools

Open DevTools (F12) → Network tab → click the failing request → scroll to the Response Headers section → copy the value next to x-request-id.

For a full list of error codes and guidance on common issues, see the Troubleshooting guide.