# 2s Image Compress

> 2s Image Compress is a paid API for AI agents from 2s.io, paid per call via x402, $0.0024/call, status unknown (last checked 2026-09-14).

Compresses an image (by URL or base64) to reduce file size, with control over format, quality, and compression effort

## Facts

- Endpoint: POST https://2s.io/api/image/compress
- Price: $0.0024/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-image-compress-6e7b175d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TUJ48jDP62d7tGN8Tcrz3

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 2s-image-compress-6e7b175d -d '<json body>'
```

Example prompt: Compress the image at https://example.com/photo.jpg to webp format with quality 75 using lossy compression at effort level 6.

## When to prefer this

Use this endpoint when you need to reduce image file sizes on demand without managing image processing infrastructure, want to convert between formats (PNG, JPEG, WebP, AVIF), or need pay-per-call pricing with no subscription commitment. Ideal for agents that occasionally need image optimization without integrating a full CDN or image pipeline.

## Known failure modes

- Invalid or unreachable image URL returns an error
- base64 payload exceeds 4.4MB limit causing rejection
- unsupported image format or corrupt image data
- quality or effort values out of allowed range (1-100 and 1-10 respectively)
- network timeout fetching remote image URL

## How this service works

The (most) everything API: 575+ pay-per-call endpoints for AI agents — ground-truth data, a full AI gateway, and agent infrastructure (storage, queues, watchers). USDC via x402, no signup, no API keys, and upto billing: pay actual usage, not the quote.

## Output

Returns a JSON object containing the compressed image data (likely as base64 or a URL), format metadata, and size information about the resulting compressed image.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "maxLength": 2048
  },
  "lossy": {
   "type": "boolean"
  },
  "effort": {
   "type": "integer",
   "maximum": 10,
   "minimum": 1
  },
  "format": {
   "enum": [
    "auto",
    "png",
    "jpeg",
    "webp",
    "avif"
   ],
   "type": "string"
  },
  "quality": {
   "type": "integer",
   "maximum": 100,
   "minimum": 1
  },
  "imageBase64": {
   "type": "string",
   "maxLength": 4400000
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-image-compress-6e7b175d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
