{"uid":"cap_DvwnH03rGS-hX3FrvGuBB","slug":"402utils-image-resize-convert-95ce26df","name":"402utils Image Resize & Convert","description":"Resize and convert an image (PNG, JPEG or WebP, up to 10 MB). Send the image bytes as the body and set options in the query: width, height, fit (contain or cover), format (webp/jpeg/png) and quality (JPEG). Returns the converted image bytes. WebP has no quality knob and AVIF is not supported (out of scope).","url":"https://402utils.com/v1/image-optimize","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"fit":{"enum":["contain","cover"],"type":"string","default":"contain"},"width":{"type":"integer","maximum":4096,"minimum":1},"format":{"enum":["webp","jpeg","png"],"type":"string","default":"webp"},"height":{"type":"integer","maximum":4096,"minimum":1},"quality":{"type":"integer","maximum":100,"minimum":1,"description":"JPEG quality (ignored for webp/png)."}}},"responseSchema":{"type":"json","example":"<binary image stream>"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","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.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_gJGO27FkT0HKDsz6NZzVl","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Resizes and converts an image (PNG, JPEG, or WebP) to a target width/height and output format with optional JPEG quality control","exampleAgentPrompt":"Can you resize this product photo to 800×600 pixels, convert it to WebP format using cover fit so it fills the frame, and give me back the optimized image bytes?","exampleUseCases":[{"title":"Convert PNG logo to WebP","prompt":"I have a PNG logo file that I need converted to WebP format at the same dimensions — can you do that and give me the resulting image bytes so I can drop it into the website?"},{"title":"Generate compressed thumbnail image","prompt":"Can you take this JPEG photo and resize it down to 300×300 pixels as a square thumbnail using cover fit, then compress it to around 75% JPEG quality so it loads fast on mobile?"},{"title":"Normalize uploaded images to standard format","prompt":"Users are uploading a mix of PNG, JPEG, and WebP profile pictures — can you convert this one to a standard 400×400 WebP so all avatars are in a consistent format and size?"}],"resultDescription":"Returns the raw converted image bytes in the requested format (WebP, JPEG, or PNG), resized to the specified dimensions using the chosen fit mode (contain or cover), with JPEG quality applied if applicable.","failureModes":["Image exceeds 10 MB size limit — request rejected","Invalid dimensions (width or height outside 1–4096 range) — validation error","Unsupported input image format (e.g. GIF, AVIF, TIFF) — unsupported format error","AVIF output format requested — out of scope, not supported","Malformed image bytes in request body — parsing error","Quality parameter provided for WebP/PNG — silently ignored, no error","Payment of 0.004 USDC not provided — 402 Payment Required response"],"whenToPreferThis":"Use this endpoint when you need a lightweight, pay-per-call image resize and format conversion without setting up a full image CDN or processing pipeline. Ideal for agents that occasionally need to prepare images for web use, thumbnail generation, or format normalization. Best when input is PNG, JPEG, or WebP under 10 MB and output is one of those three formats.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T12:46:58.464Z","isFirstParty":false}