# agent402.tools Image Crop, Rotate & Flip

> agent402.tools Image Crop, Rotate & Flip is a paid API for AI agents from agent402.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Crops an image to a specified pixel bounding box and/or rotates (90/180/270°) and flips it, returning the result as binary or a JSON data URI.

## Facts

- Endpoint: POST https://agent402.tools/api/image-crop
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-image-crop-rotate-flip-9a28ed1f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bWeyKaQn5vHaEAO47Xw1N

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 agent402-tools-image-crop-rotate-flip-9a28ed1f -d '<json body>'
```

Example prompt: Crop this image (https://example.com/photo.jpg) to a 400×300 box starting at top=50, left=100, then rotate it 90 degrees and flip it horizontally — return it as a PNG data URI.

## When to prefer this

Use this endpoint when you need deterministic, pixel-precise image cropping, rotation, and/or flipping via a simple HTTP call with no image hosting required. Prefer it over full image-editing pipelines when you only need geometric transforms (no filters, AI upscaling, or generative changes). Ideal for preprocessing images before further analysis or for normalizing image orientation.

## Known failure modes

- Image URL unreachable or returns non-image content — server fetch fails
- Image file exceeds 5MB cap — request rejected
- Invalid crop dimensions (width/height extend beyond image bounds) — error returned
- Unsupported rotate value (not 90/180/270) — validation error
- Base64 input is malformed or not a valid image — decoding error
- Invalid flip value (not horizontal/vertical/both) — validation error

## How this service works

Crop an image to a pixel box, and/or rotate (90/180/270) and flip it - applied in that order. Send a public image URL or a base64 image. Returns the result as binary, or as a JSON data URI with dataUri:true. Deterministic.

## Output

Returns either raw binary image data (PNG/JPEG/BMP) or, if dataUri:true, a JSON object containing the data URI string, image width in pixels, image height in pixels, and byte size of the result.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "top": {
   "type": "number",
   "description": "crop box top edge in px (default 0)"
  },
  "url": {
   "type": "string",
   "description": "public http(s) image URL (fetched server-side, 5MB cap)"
  },
  "flip": {
   "type": "string",
   "description": "horizontal | vertical | both"
  },
  "left": {
   "type": "number",
   "description": "crop box left edge in px (default 0)"
  },
  "image": {
   "type": "string",
   "description": "alternative: base64 image, optionally a data: URL"
  },
  "width": {
   "type": "number",
   "description": "crop box width in px (required with height for a crop)"
  },
  "format": {
   "type": "string",
   "description": "output format: png (default), jpeg, bmp"
  },
  "height": {
   "type": "number",
   "description": "crop box height in px"
  },
  "rotate": {
   "type": "number",
   "description": "rotate by 90, 180, or 270 degrees"
  },
  "dataUri": {
   "type": "boolean",
   "description": "return JSON {dataUri, width, height, bytes} instead of binary"
  },
  "quality": {
   "type": "number",
   "description": "jpeg quality 1-100 (default 80)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "bytes": 4242,
  "width": 60,
  "height": 40,
  "dataUri": "data:image/png;base64,iVBORw0KG…"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-image-crop-rotate-flip-9a28ed1f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
