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.
/api/v1/image/processTry it out
/api/v1/image/processParameters
Code
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
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Required | HTTPS URL of source image (max 10 MB) |
| operations | array | Required | Array of operations (max 10) |
| outputFormat | string | Optional | jpeg, 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 imageX-Original-Size — Original image size in bytesX-Processed-Size — Processed image size in bytesX-Operations — Comma-separated list of applied operationsRate Limits
| Plan | Requests/Month | Rate Limit |
|---|---|---|
| Free | 500 | 5 req/min |
| Starter | 5,000 | 30 req/min |
| Professional | 50,000 | 120 req/min |
| Business | 250,000 | 500 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.