{"uid":"cap_bWeyKaQn5vHaEAO47Xw1N","slug":"agent402-tools-image-crop-rotate-flip-9a28ed1f","name":"agent402.tools Image Crop, Rotate & Flip","description":"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.","url":"https://agent402.tools/api/image-crop","method":"POST","headers":{},"bodySchema":{"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)"}}},"responseSchema":{"type":"json","example":{"bytes":4242,"width":60,"height":40,"dataUri":"data:image/png;base64,iVBORw0KG…"}},"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_pWVSfgP8b2KxOGOsrqGmP","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 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.","exampleAgentPrompt":"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.","exampleUseCases":null,"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T01:18:00.626Z","isFirstParty":false}