{"uid":"cap_YlVLT_A3q8f9Pgd7fT606","slug":"bacon-services-web-image-optimizer-9fef1d0e","name":"Bacon Services Web Image Optimizer","description":"Web Image Optimizer: Resizes one image so its longest side is at most max_width pixels (never enlarging it) and encodes it as WebP at the given quality. Transparency is kept. Metadata is not carried over, so a JPEG's EXIF orientation is not applied.","url":"https://baconservices.com/api/agent-commerce/v1/capabilities/web-image-optimizer/execute?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"quality":{"type":"integer","default":80,"maximum":95,"minimum":40,"description":"WebP quality."},"image_url":{"type":"string","format":"uri","description":"A public https URL of a PNG, JPEG or WebP image."},"max_width":{"type":"integer","default":1600,"maximum":4096,"minimum":64,"description":"Longest side of the output, in pixels."},"image_base64":{"type":"string","description":"The image bytes, base64-encoded.","contentEncoding":"base64"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_byimDj6rM6j7S_61mT5CV","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Resizes an image so its longest side is at most a specified pixel limit and re-encodes it as WebP at a given quality, preserving transparency but discarding metadata.","exampleAgentPrompt":"Can you resize this image (https://example.com/photo.jpg) so its longest side is at most 1200 pixels and convert it to WebP at quality 75?","exampleUseCases":[{"title":"E-commerce product image optimization","prompt":"Take this product image at https://myshop.com/images/sneaker.png and resize it so the longest side is no more than 800 pixels, then convert it to WebP at quality 80 — I want it small and sharp for our product listing page."},{"title":"Blog hero image web conversion","prompt":"I have a large JPEG hero image for my blog post at https://cdn.myblog.com/hero.jpg — can you convert it to WebP at quality 70 and cap the longest side at 1600 pixels so it loads faster for readers?"},{"title":"User avatar thumbnail creation","prompt":"Shrink this user-uploaded PNG (https://uploads.myapp.com/avatar_raw.png) to at most 256 pixels on the longest side and encode it as WebP at quality 85, keeping any transparency intact."}],"resultDescription":"The endpoint returns the processed image as a WebP-encoded file. The output image has its longest side capped at the requested max_width (never upscaled), encoded at the specified WebP quality. Transparency from the source PNG or WebP is preserved; EXIF and other metadata are stripped.","failureModes":["Image URL is not publicly accessible or returns a non-200 response — request fails with an error","Unsupported source format (e.g. GIF, TIFF, SVG) — format error returned","max_width or quality value out of allowed range — validation error","Image is already smaller than max_width — returned as-is (no upscaling, but still re-encoded to WebP)","Network timeout fetching remote image URL — timeout error","Base64 payload is malformed or too large — decoding error"],"whenToPreferThis":"Choose this endpoint when you need a single, low-cost ($0.01 per call) serverless operation to resize and convert one image to WebP without upscaling, especially when preserving transparency matters and stripping EXIF metadata is acceptable. Prefer it over general-purpose image CDNs when you want deterministic per-call pricing and x402 micropayment compatibility. If you need background removal, use the sibling Remove Background endpoint instead.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-14T12:57:11.304Z","isFirstParty":false,"canonicalSlug":"bacon-services-web-image-optimizer-9fef1d0e"}