# x402 Image Tools – Resize

> x402 Image Tools – Resize is a paid API for AI agents from image.kagurazaka.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-29).

Resizes an image from a URL to specified width and/or height with configurable fit mode, optional format conversion, and returns a signed CDN URL valid for one hour.

## Facts

- Endpoint: POST https://image.kagurazaka.dev/v1/resize?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-resize-9e6dd1bf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__xIwLA02Ci_tdImu04fzB

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-resize-9e6dd1bf -d '<json body>'
```

Example prompt: Can you resize this product image at https://example.com/product.jpg to 800 pixels wide and 600 pixels tall, containing it inside that box without cropping, and convert it to WebP?

## When to prefer this

Choose this endpoint when you need to resize an image from a remote URL to specific pixel dimensions with fine control over fit behavior (cover, contain, inside, outside, fill), optionally converting the format in the same call. It is ideal for programmatic media pipelines, e-commerce asset preparation, and responsive web image generation where you need a short-lived CDN link to the result rather than a raw binary. Prefer it over the convert-only or thumbnail endpoints when dimension control matters and smart-crop is not needed.

## Known failure modes

- Image URL is not publicly accessible or returns a non-200 status — endpoint cannot fetch the source
- Image exceeds 20 MB or 40 megapixels — rejected with size limit error
- Unsupported image format (e.g. BMP, raw) — only JPEG, PNG, WebP, AVIF, GIF, TIFF, SVG accepted
- Both width and height omitted — at least one dimension required
- Width or height out of range (must be 1–8192) — validation error
- enlarge=false (default) prevents upscaling when requested dimensions exceed source — result will be smaller than requested
- Payment not included or insufficient — x402 payment required response
- Signed URL expires after 1 hour — subsequent access returns 403

## How this service works

Resize an image at a URL to a width, a height or both, keeping the aspect ratio inside the box by default (cover, contain, inside, outside or fill), optionally converting it. Returns a signed URL of the result, valid for an hour.

## Output

A JSON object containing: a signed CloudFront URL to the resized image (valid for 3600 seconds), the output width and height in pixels, the output format, the file size in bytes, the expiry time in seconds, and the original file size in bytes. If the 'inline' flag was set and the result is under 1 MB, a data URL of the image is also included.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "fit": {
   "enum": [
    "cover",
    "contain",
    "inside",
    "outside",
    "fill"
   ],
   "type": "string",
   "description": "how to fit the box (default inside)"
  },
  "url": {
   "type": "string",
   "description": "https URL of a JPEG, PNG, WebP, AVIF, GIF, TIFF or SVG image (up to 20 MB, 40 megapixels)"
  },
  "width": {
   "type": "integer",
   "description": "target width (1-8192)"
  },
  "format": {
   "enum": [
    "webp",
    "avif",
    "png",
    "jpeg",
    "gif",
    "tiff"
   ],
   "type": "string",
   "description": "output format (default: the input's)"
  },
  "height": {
   "type": "integer",
   "description": "target height (1-8192)"
  },
  "inline": {
   "type": "boolean",
   "description": "also return the image as a data URL when it is at most 1 MB"
  },
  "enlarge": {
   "type": "boolean",
   "description": "allow making the image larger (default false)"
  },
  "quality": {
   "type": "integer",
   "description": "1-100"
  }
 }
}
```

## 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
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-image-tools-resize-9e6dd1bf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from image.kagurazaka.dev](https://www.zero.xyz/host/image.kagurazaka.dev/llms.txt)
