canonical: https://jentic.com/apis/mochify.app/mochify

# Mochify App Mochify API

The Mochify API compresses and converts images to JPG, PNG, WebP, AVIF, or JPEG XL, processing the bytes in memory and returning the result without writing the original to disk. One call can resize, smart-crop around the subject, remove the background, add a generated shadow or background, rotate, strip EXIF, cap the output at a target byte size, and return a ZIP of several format and width variants. It also rasterizes or splits PDFs and builds a PDF from images, generates images from a text prompt on paid plans, and accepts large files through a chunked upload session.

## For AI agents

Compress, convert, resize, and remove backgrounds from images, rasterize or split PDFs, build PDFs from images, and generate images from prompts with Mochify. Accepts a Bearer key or x-api-key header, or anonymous free-tier calls.

## Scope

Does not host or serve images from a CDN, manage a media library, or edit video. Use for one-shot image compression, conversion, background removal, PDF conversion, and prompt-based image generation only.

## Capabilities

- Compress and convert an image to JPG, PNG, WebP, AVIF, or JXL with quality or lossless settings
- Cap an image at a targetBytes ceiling by lowering quality, dimensions, or both
- Return a ZIP of several formats and widths from one upload using types and sizes
- Remove an image background and add a generated shadow or background
- Rasterize PDF pages to images, split a PDF, or combine images into one PDF
- Generate an image from a text prompt in aspect ratios such as 16:9 or 1:1
- Upload large images in ordered chunks and receive the processed result

## Use cases

### Agent Image Optimisation Through Jentic

An AI agent preparing images for a website or store listing sends each file to Mochify and gets back a web-ready version in the right format and size. Through Jentic the agent finds the squish operation by intent, sets type, width, and targetBytes as query parameters, and posts the raw image bytes with a stored key so the calls count against your plan quota.

Example prompt: Compress an uploaded JPEG to webp at width 1200 with targetBytes 200000 and targetLever 'quality', and stripExif true

### E-Commerce Product Photo Cleanup

Online sellers remove the background from product shots, composite the subject with a generated drop shadow or a flat background colour, smart-crop to a square around the subject, and export WebP and AVIF variants at several widths in a single ZIP for responsive storefront images.

Example prompt: Process a product photo with removeBackground true, generate 'shadow', smartCrop true at 1000x1000, types 'webp,avif', and sizes '500,1000'

### PDF to Image and Image to PDF

Document workflows rasterize PDF pages to PNG or JPG at a chosen DPI for previews, split a PDF into separate pages, or combine scanned images into one multi-page PDF sized to A4, Letter, or the image itself. Rasterize and split are paid-plan features.

Example prompt: Create a PDF from three uploaded images with op 'create', page 'a4', and combine true

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/v1/squish` | Compress and/or convert an image |
| POST | `/v1/pdf` | Rasterize, split, or create a PDF |
| POST | `/v1/generate` | Generate an image from a text prompt |
| POST | `/v1/upload/init` | Start a chunked upload session |
| POST | `/v1/upload/complete` | Finish a chunked upload |
| GET | `/v1/checkTokens` | Check remaining quota |

## Key resources

- **Image Squish** — Compression, conversion, resizing, cropping, and AI background operations on one image
- **PDF Processing** — Rasterize or split PDFs and create PDFs from images
- **Image Generation** — Text-to-image generation with format and size variants
- **Chunked Uploads** — Session-based uploads for large images over unreliable connections
- **Quota** — Remaining credits for the caller's plan

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 65 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 74 / 100
  - Developer Experience & Jentic Compatibility: 64 / 100
  - AI-Readiness & Agent Experience: 49 / 100
  - Agent Usability: 94 / 100
  - Security: 55 / 100
  - AI Discoverability: 78 / 100
- **View full report:** https://jentic.com/apis/mochify.app/mochify/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring Mochify by hand means choosing between its Bearer and x-api-key headers (only x-api-key reports a bad key), posting raw image bytes rather than multipart, and handling ZIP responses for multi-variant requests. Through Jentic you install once, import Mochify from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** Mochify passes every setting as a query parameter or body field on a few fixed paths, so rules bound which operations your agent may call rather than which files it processes. You choose the operations it may call, so credit-heavy ones like text-to-image generation are not included unless you add them.
- **Credential handling:** Your Mochify key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'compress an image' or 'convert a PDF to images', and Jentic returns the matching Mochify operation with its input schema so the agent calls the right endpoint without reading the reference docs.

## Related APIs

- **Cloudinary Upload API** — Upload, transform, and host images and video on a CDN
- **remove.bg** — Dedicated AI background removal
- **Bannerbear** — Template-based image and video generation

## FAQ

### What authentication does the Mochify API use?

Per its OpenAPI spec, the Mochify API accepts a dashboard-issued key as `Authorization: Bearer <key>` or in the `x-api-key` header, and authentication is optional: calls with no credential fall back to anonymous, IP-metered free-tier limits, and the health check is public. An unresolvable Bearer key is silently treated as anonymous, while x-api-key reports it as invalid. Through Jentic the key is stored once, encrypted, by your own Jentic One instance and injected at call time.

### Can I hit a specific file size with the Mochify API?

Yes. Set targetBytes on the squish operation to the maximum output size in bytes, and targetLever to quality, dimensions, or both to choose what Mochify may change to get there. Combine it with type, width, and lossless where the format allows.

### Can I limit what my agent is allowed to do with the Mochify API?

Yes. For example, write a rule that allows only the squish and checkTokens operations, so the agent can compress images and read its remaining quota but cannot spend credits on text-to-image generation, and every call it makes is logged.

### What are the rate limits for the Mochify API?

The Mochify OpenAPI spec meters image requests by plan quota: 25 per month on Free, 300 on Seller, and 1200 on Pro, with anonymous callers limited to 3 per session or batch by IP. Image generation costs 10 credits per successful call. Check https://mochify.app for current plan details.

### How do I compress an image with Mochify through Jentic?

Search Jentic for the intent 'compress an image', which returns the Mochify squish operation on `/v1/squish` with its input schema; the agent posts the raw image bytes with type, width, and quality as query parameters and receives the processed image. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Is there a Mochify MCP server?

You don't need an MCP server to give your agent the Mochify API. Jentic connects it directly from the API Directory: import it, store your key once, and your agent calls the image, PDF, and generation operations. Operations are discovered on demand, so no extra tool definitions are loaded into the agent's context.
