# fastapi.online — Image Compress

> fastapi.online — Image Compress is a paid API for AI agents from api.fastapi.online, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Compresses an image file (PNG, JPEG, or WebP) with configurable output format and quality, returning a smaller image file.

## Facts

- Endpoint: POST https://api.fastapi.online/image-compress
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastapi-online-image-compress-95c82c41
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8hNFkavmXw1aTdDwg4V5T

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 fastapi-online-image-compress-95c82c41 -d '<json body>'
```

Example prompt: Can you compress this JPEG image to reduce its file size? Use JPEG format with quality set to 75 so it loads faster on the web.

## When to prefer this

Choose this endpoint when you need a simple, per-call, no-signup image compression API that accepts PNG, JPEG, or WebP and supports configurable output format and quality. It is ideal for agents that want to pay per use with crypto (USDC via x402) rather than maintain a subscription. Prefer it for lightweight, one-off compression tasks in automated pipelines where cost transparency per call matters.

## Known failure modes

- Unsupported file format (non-PNG/JPEG/WebP input) returns an error
- Invalid quality value outside accepted range returns a validation error
- Missing or malformed file binary returns a 400 bad request
- Payment not included or insufficient triggers a 402 Payment Required response
- Server-side model or processing failure returns a 500 error

## How this service works

Chat, embeddings, OCR, speech-to-text, image editing, image understanding (captioning/Q&amp;A), text-to-speech, translation, writing tools, classification tools, developer tools, local utilities, format/checksum validators, encoding &amp; crypto utilities, date/time calculators, geo/coordinate math, math &amp; finance calculators, novelty tools, and business/social writing generators — 179 endpoints in all, across multiple specialized self-hosted models. Pay per call with crypto — no signup — or get an API key.

## Output

A compressed image file returned as binary data, in the requested output format (PNG, JPEG, or WebP) and at the specified quality level, with a reduced file size compared to the original.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "file": {
   "type": "string",
   "format": "binary",
   "description": "Image file (PNG/JPEG/WebP)"
  },
  "format": {
   "type": "string"
  },
  "quality": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastapi-online-image-compress-95c82c41/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.fastapi.online](https://www.zero.xyz/host/api.fastapi.online/llms.txt)
