# x402 Image Tools – Compress

> x402 Image Tools – Compress is a paid API for AI agents from 7fg5bxb40m3f0v23.68r.lambda-web.us-east-1.on.aws, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-29).

Re-encodes a JPEG or PNG image using mozjpeg/palette quantization, removes metadata, optionally scales or converts it, and returns a CDN URL with byte-savings stats.

## Facts

- Endpoint: POST https://7fg5bxb40m3f0v23.68r.lambda-web.us-east-1.on.aws/v1/compress?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-image-tools-compress-773ccaff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__HByP_dWeAIRnCw5mAuT4

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-image-tools-compress-773ccaff -d '<json body>'
```

Example prompt: Can you compress this product photo for me — https://example.com/product.jpg — convert it to WebP at quality 80, scale it down to a max width of 1200 pixels, and tell me how many bytes I saved?

## When to prefer this

Choose this endpoint when you need to reduce image file size for web delivery, bandwidth savings, or storage cost, and want detailed byte-savings reporting alongside a ready-to-use CDN URL. It is particularly well-suited for JPEG and PNG optimization (mozjpeg, palette quantization) and supports format conversion in the same call. Prefer it over a generic resize endpoint when compression ratio and metadata stripping are the primary goals, rather than dimension changes.

## Known failure modes

- Image URL unreachable or returns non-200 status — endpoint cannot fetch source image
- Image exceeds 20 MB or 40 megapixels limit — request rejected
- Unsupported format provided in the format enum — validation error
- quality value outside 1–100 range — parameter error
- Compressed result is not smaller than the original — savings may be 0% or negative
- Payment not accepted or x402 auth failure — 402 response

## How this service works

Make an image smaller in bytes: re-encode it (mozjpeg for JPEG, palette quantization for PNG) with metadata removed, optionally scaled down to a maximum width or converted, and report how much was saved.

## Output

A JSON object with a CDN URL to the compressed image (valid for 3600 seconds), the output file size in bytes, the input file size in bytes, percentage saved, output dimensions (width and height), and the output format. Optionally includes the image as a base64 data URL if it is under 1 MB and inline was requested.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "https URL of a JPEG, PNG, WebP, AVIF, GIF, TIFF or SVG image (up to 20 MB, 40 megapixels)"
  },
  "format": {
   "enum": [
    "webp",
    "avif",
    "png",
    "jpeg",
    "gif",
    "tiff"
   ],
   "type": "string",
   "description": "output format (default: the input's)"
  },
  "inline": {
   "type": "boolean",
   "description": "also return the image as a data URL when it is at most 1 MB"
  },
  "quality": {
   "type": "integer",
   "description": "1-100 (default 75)"
  },
  "max_width": {
   "type": "integer",
   "description": "scale down to at most this width"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "url": "https://dn8i8p8knpn68.cloudfront.net/results/images/3f1c2b9e.webp?Expires=...",
  "bytes": 48213,
  "width": 800,
  "format": "webp",
  "height": 600,
  "expires_in": 3600,
  "input_bytes": 912345,
  "saved_percent": 62.4
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-image-tools-compress-773ccaff/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 7fg5bxb40m3f0v23.68r.lambda-web.us-east-1.on.aws](https://www.zero.xyz/host/7fg5bxb40m3f0v23.68r.lambda-web.us-east-1.on.aws/llms.txt)
