{"uid":"cap_lCDwBR-1nNDl5B9-SDhcD","slug":"x402-image-tools-crop-cb5973a5","name":"x402 Image Tools – Crop","description":"Cut a region out of an image (left, top, width, height), or, without left and top, crop it to the given size around its most interesting region (libvips attention strategy).","url":"https://7fg5bxb40m3f0v23.68r.lambda-web.us-east-1.on.aws/v1/crop?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"top":{"type":"integer","description":"top edge"},"url":{"type":"string","description":"https URL of a JPEG, PNG, WebP, AVIF, GIF, TIFF or SVG image (up to 20 MB, 40 megapixels)"},"left":{"type":"integer","description":"left edge; leave out with top for a smart crop"},"width":{"type":"integer","description":"crop width"},"format":{"enum":["webp","avif","png","jpeg","gif","tiff"],"type":"string","description":"output format (default: the input's)"},"height":{"type":"integer","description":"crop height"},"inline":{"type":"boolean","description":"also return the image as a data URL when it is at most 1 MB"}}},"responseSchema":{"type":"json","example":{"url":"https://dn8i8p8knpn68.cloudfront.net/results/images/3f1c2b9e.webp?Expires=...","bytes":48213,"width":600,"format":"webp","height":600,"expires_in":3600,"input_bytes":912345}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_txO1dLWRMb1cU31nwj-4h","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Crops a region from an image by explicit coordinates or smart-crops to a given size around the most visually interesting area using libvips attention strategy.","exampleAgentPrompt":"Crop this image (https://example.com/photo.jpg) to 800×600 pixels starting from the top-left corner at coordinates (100, 50), and return it as a WebP.","exampleUseCases":[{"title":"Smart crop product photo for thumbnail","prompt":"Take this product image at https://shop.example.com/items/shoe.png and smart-crop it to 400×400 pixels centered on the most interesting part — output it as WebP."},{"title":"Extract logo region from banner","prompt":"Cut out a 200×80 region from https://example.com/banner.jpg starting at left 40, top 20 — keep it as a JPEG."},{"title":"Attention-based crop for social media post","prompt":"I need to crop this photo at https://cdn.myblog.com/hero.jpg to 1200×630 pixels for a social media preview — use the smart cropping to make sure the interesting part is centered, and give me a PNG."}],"resultDescription":"A JSON object containing a temporary CDN URL to the cropped image, its width and height in pixels, file format, size in bytes, and expiry time in seconds. If 'inline' is true and the result is under 1 MB, a base64 data URL is also included.","failureModes":["Image URL not reachable or not returning a valid image — HTTP error or invalid format response","Image exceeds 20 MB or 40 megapixel limit — request rejected","Crop coordinates out of bounds for the source image — likely error or clamped result","Unsupported image format — only JPEG, PNG, WebP, AVIF, GIF, TIFF, SVG accepted","Payment failure via x402 protocol — 402 Payment Required if USDC not provided","Result URL expires after 3600 seconds — subsequent access will fail"],"whenToPreferThis":"Choose this endpoint when you need to extract a specific rectangular region from an image by pixel coordinates, or when you want intelligent subject-aware cropping to a target size without manually specifying coordinates. It is ideal for generating thumbnails, focusing on subjects, or preparing images for fixed-dimension displays. Prefer it over a generic resize endpoint when spatial cropping (not just scaling) is required, and over a thumbnail endpoint when you need full control over output dimensions or coordinate-based extraction.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T12:36:32.859Z","isFirstParty":false,"canonicalSlug":"x402-image-tools-crop-cb5973a5"}