{"uid":"cap_EpyQX8VN_8tZQ2ryxraHP","slug":"agent-image-compression-api-841d02c8","name":"Agent Image Compression API","description":"Pay-per-image compression for AI agents (x402 + MPP).","url":"https://agent-image-compress-production.up.railway.app/api/compress-upload","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"properties":{}},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["format","contentType","inputBytes","outputBytes","percentSaved","width","height","image"],"properties":{"image":{"type":"string","description":"Base64-encoded compressed image bytes."},"width":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"description":"Output width in px."},"format":{"enum":["png","jpeg","webp","avif"],"type":"string","description":"Output image format."},"height":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"description":"Output height in px."},"inputBytes":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"description":"Source size in bytes."},"contentType":{"type":"string","description":"MIME type of the returned image."},"outputBytes":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"description":"Compressed size in bytes."},"percentSaved":{"type":"number","description":"Percent reduction (can be negative)."}},"additionalProperties":false}}}}},"responseSchema":{"type":"json","example":{"image":"UklGRk4AAABXRUJQVlA4IEIAAAAwAQCdASo...<base64>","width":1024,"format":"webp","height":768,"inputBytes":102400,"contentType":"image/webp","outputBytes":38211,"percentSaved":62.7}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_S3HhesbWSzr3QKowW5BGu","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compresses and converts uploaded images to WebP format, returning the compressed image as base64 with size savings metrics, billed per-image via x402/USDC micropayment.","exampleAgentPrompt":"Can you compress this image I'm uploading and convert it to WebP so I can see how many bytes it saves? I want the compressed image back as base64.","exampleUseCases":null,"resultDescription":"A JSON object containing: the compressed image as a base64-encoded WebP string, the output image width and height in pixels, input and output byte sizes, percent of bytes saved, and the content type ('image/webp').","failureModes":["Invalid or unsupported image format — returns error response","Payment not provided or rejected via x402 — returns 402 Payment Required","Image too large or malformed upload — returns 400 Bad Request","Server unavailable on Railway deployment — returns 503 or timeout","Empty or missing image body — returns error indicating no file received"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to compress individual images on a pay-per-use basis without a subscription, especially in automated pipelines where x402 micropayments (USDC) are already supported. Ideal when WebP output format and base64 encoding are acceptable, and when size reduction metrics (percent saved, byte counts) are needed alongside the compressed image.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-16T00:38:34.445Z","isFirstParty":false}