Optimize image for the web
optimize_imageResize an image to a max width and encode as WebP to shrink files for web use, preserving transparency. Costs 0.01 USDC per call on Base.
Instructions
Resizes one image so its longest side is at most max_width pixels (never enlarging it) and encodes it as WebP at the given quality. Transparency is kept; metadata is not carried over. Costs 0.01 USDC per call (real money) on Base, paid from the buyer's wallet over x402 after the buyer's spending limits are checked. Input: PNG, JPEG, WEBP, up to 8 MB, at most 8000 px. Give exactly one of image_url or image_path. Output: image/webp, as a download link (and a file with save_to).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| quality | No | WebP quality. | |
| save_to | No | Optional local file path to save the result to (image/webp). | |
| image_url | No | A public https URL of the image. | |
| max_width | No | Longest side of the output, in pixels. | |
| overwrite | No | Replace save_to if it exists. Default false. | |
| image_path | No | A local image file to send (read by this server, sent base64). | |
| allow_repeat | No | Buy again even if the same request was bought in the last 10 minutes. Default false: the earlier result is returned and nothing is charged. | |
| max_price_usdc | No | Optional: refuse if Bacon asks more than this, in USDC. |