Home / APIs / image API

Image Processing API for Developers

Transform images with Sharp-backed REST endpoints. Upload multipart field file and get processed bytes back synchronously for common ops like resize, compress, convert, and metadata strip — plus advanced ops like background remove and upscale.

Features

What this API actually supports in production today.

  • Resize, compress, convert (JPEG/PNG/WebP/AVIF)
  • Thumbnails and strip metadata
  • Crop, rotate, flip, grayscale
  • Background remove and upscale (higher credit cost)
  • Sync responses — no job polling for standard image ops

Common use cases

  • User upload pipelines and CDN prep
  • Thumbnail generation for marketplaces
  • Format conversion for email/web delivery
  • Background removal for product photos

API endpoints

Base URL https://thefatbaby.com/api. Authenticate with Authorization: Bearer fb_live_YOUR_KEY.

MethodPathSummaryCredits
POST/v1/image/compressCompress an imageTypically 1–2 credits
POST/v1/image/resizeResize width/height/fitTypically 1–2 credits
POST/v1/image/convertConvert formatTypically 1–2 credits
POST/v1/image/infoRead image metadata1 credit
POST/v1/image/background-removeRemove backgroundHigher cost (about 20 credits)
POST/v1/image/upscaleUpscale imageHigher cost (about 25 credits)

Examples

Primary endpoint /v1/image/compress · Standard transforms are low single-digit credits; AI-style ops cost more. Check response credit headers.

cURL

curl -X POST https://thefatbaby.com/api/v1/image/compress \
  -H "Authorization: Bearer fb_live_YOUR_KEY" \
  -F "file=@photo.jpg" -F "quality=80" \
  --output out.jpg

JavaScript

const form = new FormData();
form.append('file', fileInput.files[0]);
form.append('quality', '80');
const res = await fetch('https://thefatbaby.com/api/v1/image/compress', {
  method: 'POST',
  headers: { Authorization: 'Bearer fb_live_YOUR_KEY' },
  body: form
});
const blob = await res.blob();

Python

import requests
r = requests.post(
  'https://thefatbaby.com/api/v1/image/compress',
  headers={'Authorization': 'Bearer fb_live_YOUR_KEY'},
  files={'file': open('photo.jpg','rb')},
  data={'quality': '80'},
)
open('out.jpg','wb').write(r.content)

Request

multipart/form-data
file=@photo.jpg
quality=80

Binary response: HTTP 200 image bytes with Content-Type matching the output format

Pricing & credits

Low-cost sync transforms for everyday ops; background-remove and upscale use higher credit rates.

Common errors

  • 400file_required or unsupported image
  • 402insufficient_credits
  • 413file too large (about 20MB limit)

FAQ

Is image processing async?

Standard /v1/image/* transforms respond synchronously with the image body. Only heavier product flows that create jobs would differ.

What formats are supported?

Common inputs include JPEG, PNG, WebP, AVIF, and GIF. Convert supports jpeg, png, webp, and avif outputs.

Try without code

Use the matching online tool, then automate the same workflow with this API.