New: the developer API now does watermarks. Read more

Developers  /  v1

One request per picture

Send a multipart form with the image and a few fields. The response is the processed image itself, so you can pipe it straight to a file or your storage.

Keys and limits

Create a key in your account under API keys and send it as a bearer token. Keys are shown once; store them like a password.

Authorization: Bearer pxl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • Each call that returns an image uses 1 credit. Reading image info is free.
  • The file size limit and requests per minute come from your plan. Responses carry X-RateLimit-Remaining and X-Credits-Remaining headers.
  • Input: JPG, PNG, WebP or GIF up to 40 megapixels. Metadata is always removed from the output.

API access is included in: Studio. See plans

Errors

Errors come back as JSON with an error field.

StatusMeaning
401Missing or unknown key
402Not enough credits
403Plan without API access, or suspended account
422A field is wrong or the image cannot be read
429Too many requests this minute; see Retry-After

Resize

POST /api/v1/resize

Fields: image (required), width, height, fit (contain, cover, stretch), enlarge, output, quality

curl /api/v1/resize \
  -H "Authorization: Bearer $PIXLANE_KEY" \
  -F "image=@photo.jpg" \
  -F width=1200 -F output=webp \
  -o result.jpg

Compress

POST /api/v1/compress

Fields: image (required), quality (1-100), output

curl /api/v1/compress \
  -H "Authorization: Bearer $PIXLANE_KEY" \
  -F "image=@photo.jpg" \
  -F quality=70 \
  -o result.jpg

Convert

POST /api/v1/convert

Fields: image (required), format (jpg, png, webp, gif), quality

curl /api/v1/convert \
  -H "Authorization: Bearer $PIXLANE_KEY" \
  -F "image=@photo.jpg" \
  -F format=webp \
  -o result.webp

Crop

POST /api/v1/crop

Fields: image (required), x, y, width, height, output

curl /api/v1/crop \
  -H "Authorization: Bearer $PIXLANE_KEY" \
  -F "image=@photo.jpg" \
  -F x=0 -F y=0 -F width=800 -F height=800 \
  -o result.jpg

Rotate and flip

POST /api/v1/rotate

Fields: image (required), degrees (90, 180, 270), flip (horizontal, vertical)

curl /api/v1/rotate \
  -H "Authorization: Bearer $PIXLANE_KEY" \
  -F "image=@photo.jpg" \
  -F degrees=90 \
  -o result.jpg

Watermark

POST /api/v1/watermark

Fields: image (required), text, position, opacity (5-100), size

curl /api/v1/watermark \
  -H "Authorization: Bearer $PIXLANE_KEY" \
  -F "image=@photo.jpg" \
  -F "text=© Studio" -F position=bottom-right \
  -o result.jpg

Remove metadata

POST /api/v1/strip

Fields: image (required), output, quality

curl /api/v1/strip \
  -H "Authorization: Bearer $PIXLANE_KEY" \
  -F "image=@photo.jpg" \
  -o result.jpg

Image info

POST /api/v1/info

Returns width, height, format and size as JSON. Free.

{ "width": 4032, "height": 3024, "format": "jpg", "bytes": 2481190 }

GET /api/v1/me returns your plan, credits and limits.

JavaScript example

const form = new FormData();
form.append('image', fileInput.files[0]);
form.append('width', '800');
form.append('output', 'webp');

const res = await fetch('/api/v1/resize', {
  method: 'POST',
  headers: { Authorization: `Bearer ${key}` },
  body: form,
});
if (!res.ok) throw new Error((await res.json()).error);
const blob = await res.blob();