The Morphix API lets you convert, resize, crop, and strip metadata from images programmatically. Send a POST request with an image file, get a processed image back. No SDKs to install, no complex configuration. It works with any language that can make HTTP requests.
This guide walks through authentication, every available endpoint, and working code examples.
What Can the API Do?
The API exposes four endpoints, each handling a specific image operation:
| Endpoint | Method | Description |
|---|---|---|
/api/v1/convert |
POST | Convert between JPG, PNG, WebP, and AVIF |
/api/v1/resize |
POST | Resize an image to specific dimensions |
/api/v1/crop |
POST | Crop an image with exact pixel coordinates |
/api/v1/remove-metadata |
POST | Strip EXIF, IPTC, and XMP metadata |
All endpoints accept a file upload via multipart/form-data and return the processed image as the response body. The response content type matches the output format (e.g., image/webp for WebP output).
Authentication
Every API request requires a valid API key sent in the Authorization header as a Bearer token:
Authorization: Bearer YOUR_API_KEY
You can generate an API key from your account dashboard. Each key is tied to your account and your plan's rate limits.
Keep your API key secret. Do not commit it to version control, embed it in client-side code, or share it publicly. Use environment variables or a secrets manager.
Your First API Call | Convert an Image
The simplest operation is converting an image from one format to another. Here is a complete example that converts a JPG file to WebP:
cURL:
curl -X POST https://morphix.tools/api/v1/convert \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@photo.jpg" \
-F "format=webp" \
-F "quality=80" \
--output photo.webp
Python (requests):
import requests
response = requests.post(
"https://morphix.tools/api/v1/convert",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files={"file": open("photo.jpg", "rb")},
data={"format": "webp", "quality": 80},
)
with open("photo.webp", "wb") as f:
f.write(response.content)
JavaScript (Node.js, fetch):
const fs = require("fs");
const form = new FormData();
form.append("file", new Blob([fs.readFileSync("photo.jpg")]), "photo.jpg");
form.append("format", "webp");
form.append("quality", "80");
const response = await fetch("https://morphix.tools/api/v1/convert", {
method: "POST",
headers: { Authorization: "Bearer YOUR_API_KEY" },
body: form,
});
fs.writeFileSync("photo.webp", Buffer.from(await response.arrayBuffer()));
Parameters:
| Parameter | Required | Values | Default |
|---|---|---|---|
file |
Yes | Image file (JPG, PNG, WebP, AVIF) | |
format |
Yes | jpg, png, webp, avif |
|
quality |
No | 1 to 100 | 80 |
Resize and Crop Endpoints
Resize changes the dimensions of the image while preserving all content:
curl -X POST https://morphix.tools/api/v1/resize \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@photo.jpg" \
-F "width=800" \
-F "height=600" \
--output photo-resized.jpg
| Parameter | Required | Description |
|---|---|---|
file |
Yes | Image file |
width |
Yes | Target width in pixels |
height |
Yes | Target height in pixels |
Crop extracts a rectangular area from the image using pixel coordinates:
curl -X POST https://morphix.tools/api/v1/crop \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@photo.jpg" \
-F "x=100" \
-F "y=50" \
-F "width=800" \
-F "height=600" \
--output photo-cropped.jpg
| Parameter | Required | Description |
|---|---|---|
file |
Yes | Image file |
x |
Yes | Left offset in pixels |
y |
Yes | Top offset in pixels |
width |
Yes | Crop width in pixels |
height |
Yes | Crop height in pixels |
Remove Metadata Endpoint
Strip all EXIF, IPTC, and XMP metadata from an image:
curl -X POST https://morphix.tools/api/v1/remove-metadata \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@photo.jpg" \
--output photo-clean.jpg
The endpoint returns the same image with all metadata removed. Image orientation is applied to the pixel data before the EXIF orientation flag is stripped, so the image displays correctly everywhere.
Rate Limits and Error Handling
API rate limits depend on your plan. When you exceed your limit, the API returns a 429 Too Many Requests response.
| HTTP status | Meaning |
|---|---|
| 200 | Success, response body contains the processed image |
| 400 | Bad request, missing or invalid parameters |
| 401 | Unauthorized, invalid or missing API key |
| 413 | File too large |
| 415 | Unsupported file format |
| 429 | Rate limit exceeded |
| 500 | Server error |
Error responses return JSON with a message field explaining the issue:
{
"error": "Invalid format parameter. Accepted values: jpg, png, webp, avif"
}
Rate limit headers are included in every response:
| Header | Description |
|---|---|
X-RateLimit-Limit |
Maximum requests per window |
X-RateLimit-Remaining |
Remaining requests in current window |
X-RateLimit-Reset |
Unix timestamp when the window resets |
When you receive a 429 response, read the X-RateLimit-Reset header and wait until that timestamp before retrying.
Get Your API Key
Create your API key from the Morphix dashboard. No credit card required for the free plan.