---
title: "Optimize or convert an image (WebP, AVIF, JPEG)"
method: POST
path: "/v1/optimize"
---

# Optimize or convert an image (WebP, AVIF, JPEG)

`POST /v1/optimize`

## Request

- Base URL: `https://mcp.cleanor.app`
- URL: `https://mcp.cleanor.app/v1/optimize`
- Auth: none declared

Send multipart `file`, JSON `{ image_url }`, or raw bytes. Optional `format`, `quality` (1-100), `width` (16-4096). Returns the image bytes; add `?json=1` for JSON with base64.

## Request body

- object
  - `image_url` string, uri, required
  - `format` 'webp' | 'avif' | 'jpeg'
  - `quality` integer
  - `width` integer

## Response `200`

The optimized image.

## Other responses

- `429`: Rate limited.

---

[API](https://skmtc.dev/cleanor/apis/cleanor-api.md) · [All operations](https://skmtc.dev/cleanor/apis/cleanor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cleanor/apis/cleanor-api/revisions/5f7be54e7a84?raw)
