{"uid":"cap_P08inPqKxGfrRBxarSkCP","slug":"x402-image-tools-crop-bed57ff8","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://image.kagurazaka.dev/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_Wrp7oiW5ekjQsTIDBpMeE","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 the most visually interesting region using libvips attention strategy.","exampleAgentPrompt":"Crop this product photo at https://example.com/product.jpg to a 600×600 square centered on the most interesting region and return it as a WebP.","exampleUseCases":[{"title":"Smart crop product photo for e-commerce","prompt":"Take this product image at https://shop.example.com/shoe.png and smart-crop it to 800×800 pixels so it centers on the shoe itself — output it as a WebP."},{"title":"Extract specific region from screenshot","prompt":"I need you to cut out the chart area from this dashboard screenshot at https://cdn.example.com/dashboard.png — it starts at left 120, top 80 and is 640 pixels wide by 400 pixels tall. Save it as a PNG."},{"title":"Auto-crop portrait photo for avatar","prompt":"Smart-crop this portrait photo at https://photos.example.com/person.jpg to 400×400 pixels centered on the most interesting part of the image, and give me it back as a JPEG."}],"resultDescription":"Returns a JSON object containing a temporary CDN URL to the cropped image (valid for 1 hour), the output dimensions (width, height), file size in bytes, and the output format. Optionally includes the image as a base64 data URL if it is 1 MB or smaller and the inline flag is set.","failureModes":["Image URL unreachable or returns non-2xx — 4xx/5xx error response","Image exceeds 20 MB or 40 megapixels limit — rejected with size error","Unsupported image format (e.g. BMP, HEIC) — format error","Crop coordinates out of bounds for the image dimensions — geometry error","left/top provided without width/height or vice versa — parameter validation error","Network timeout fetching remote image — timeout error"],"whenToPreferThis":"Use this endpoint when you need to extract a specific rectangular region from an image by pixel coordinates, or when you want automatic subject-aware cropping using libvips attention strategy without needing to know where the subject is. Prefer it over generic resize endpoints when the goal is to reduce the frame of the image rather than scale it down, and over thumbnail endpoints when you need precise coordinate control or non-square output dimensions.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T12:36:33.896Z","isFirstParty":false,"canonicalSlug":"x402-image-tools-crop-bed57ff8"}