{"uid":"cap_mN0xQ8aUHPovRP66aT-WM","slug":"x402-image-tools-resize-7c0534b9","name":"x402 Image Tools – Resize","description":"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.","url":"https://7fg5bxb40m3f0v23.68r.lambda-web.us-east-1.on.aws/v1/resize?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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"}}},"responseSchema":{"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}},"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_5346m41-jq0H0d98AixsH","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":"Resize an image from a URL to specified dimensions with configurable fit mode, optional format conversion, and quality control, returning a signed CDN URL valid for one hour.","exampleAgentPrompt":"Can you resize this image — https://example.com/photo.jpg — to 800 pixels wide, keeping the aspect ratio (inside fit), and convert it to WebP?","exampleUseCases":[{"title":"Responsive web image preparation","prompt":"I need to resize https://mysite.com/hero-banner.png to 1200 pixels wide and 630 pixels tall using cover fit so it fills the box, and convert it to WebP — can you do that?"},{"title":"Email thumbnail generation","prompt":"Take this product image at https://cdn.shop.com/product-full.jpg and scale it down to fit inside a 300×300 box in JPEG format at quality 85, keeping the aspect ratio."},{"title":"Social media preview image","prompt":"Resize https://uploads.blog.com/post-cover.png to exactly 1080 pixels wide and 1080 pixels tall using fill fit, output as WebP — I want a square version for Instagram."}],"resultDescription":"A JSON object containing a signed CloudFront URL to the resized image (valid for 1 hour), the output width and height in pixels, the output format, the file size in bytes, the input file size in bytes, and an expires_in value of 3600 seconds. If inline was requested and the result is under 1 MB, a base64 data URL of the image is also included.","failureModes":["Image URL is not publicly accessible or returns a non-200 response","Image exceeds 20 MB or 40 megapixel limits","Invalid dimensions (outside 1–8192 range)","Unsupported input format (non-JPEG/PNG/WebP/AVIF/GIF/TIFF/SVG)","Both width and height omitted (no target size specified)","Payment of $0.002 USDC not provided via x402 protocol","Signed URL expires after 1 hour and result is no longer accessible"],"whenToPreferThis":"Use this endpoint when you need to resize a remotely-hosted image to specific dimensions with precise control over fit behavior (cover, contain, inside, outside, fill), optionally converting format in the same call. It's ideal for web optimization workflows, preparing images for specific layout slots, or generating display-ready variants from originals. Prefer this over a crop endpoint when you want aspect-ratio-aware scaling rather than a fixed cut.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T06:31:15.717Z","isFirstParty":false,"canonicalSlug":"x402-image-tools-resize-7c0534b9"}