{"name":"x402 Image Processing API","version":"1.0.0","description":"Pay-per-use image processing API powered by x402 protocol. Each operation costs $0.001 USDC.","payment":{"protocol":"x402","network":"base","pricePerOperation":"$0.001","currency":"USDC"},"endpoints":[{"path":"/image/optimize","method":"POST","price":"$0.001","description":"Optimize an image with optional resizing. Reduces file size while maintaining quality.","requestBody":{"image":"string (base64 encoded image data) - REQUIRED","width":"number (target width in pixels, optional)","height":"number (target height in pixels, optional)","quality":"number (0-100, default: 80)","format":"string (jpeg|png|webp|avif|thumbhash|raw, default: webp)","speed":"number (0-10, 0=slow/best quality, 10=fast/lower quality, default: 9)","filter":"boolean (use resize filter, default: true)"},"response":{"image":"string (base64 encoded processed image)","format":"string (output format)","originalWidth":"number (original image width)","originalHeight":"number (original image height)","width":"number (output image width)","height":"number (output image height)","size":"number (output file size in bytes)"},"example":{"request":{"image":"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==","width":800,"quality":85,"format":"webp"}}},{"path":"/image/resize","method":"POST","price":"$0.001","description":"Resize an image to exact dimensions.","requestBody":{"image":"string (base64 encoded image data) - REQUIRED","width":"number (target width in pixels) - REQUIRED","height":"number (target height in pixels) - REQUIRED","quality":"number (0-100, default: 80)","format":"string (jpeg|png|webp|avif|thumbhash|raw, default: webp)","speed":"number (0-10, default: 9)","filter":"boolean (use resize filter, default: true)"},"response":{"image":"string (base64 encoded processed image)","format":"string (output format)","originalWidth":"number","originalHeight":"number","width":"number","height":"number","size":"number (bytes)"},"example":{"request":{"image":"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==","width":1920,"height":1080,"format":"webp"}}},{"path":"/image/crop","method":"POST","price":"$0.001","description":"Crop an image to specified coordinates and dimensions. Note: This is a simplified implementation that resizes to crop dimensions.","requestBody":{"image":"string (base64 encoded image data) - REQUIRED","x":"number (x coordinate of crop start) - REQUIRED","y":"number (y coordinate of crop start) - REQUIRED","width":"number (width of crop area) - REQUIRED","height":"number (height of crop area) - REQUIRED","quality":"number (0-100, default: 80)","format":"string (jpeg|png|webp|avif|thumbhash|raw, default: webp)","speed":"number (0-10, default: 9)"},"response":{"image":"string (base64 encoded processed image)","format":"string (output format)","originalWidth":"number","originalHeight":"number","width":"number","height":"number","size":"number (bytes)"},"example":{"request":{"image":"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==","x":100,"y":100,"width":500,"height":500,"format":"webp"}}},{"path":"/image/filter","method":"POST","price":"$0.001","description":"Apply filters to an image. Note: This is a simplified implementation. Advanced filters require additional libraries.","requestBody":{"image":"string (base64 encoded image data) - REQUIRED","filterType":"string (grayscale|sepia|blur|sharpen|brightness|contrast) - REQUIRED","intensity":"number (0-100, filter intensity, optional)","quality":"number (0-100, default: 80)","format":"string (jpeg|png|webp|avif|thumbhash|raw, default: webp)","speed":"number (0-10, default: 9)"},"response":{"image":"string (base64 encoded processed image)","format":"string (output format)","originalWidth":"number","originalHeight":"number","width":"number","height":"number","size":"number (bytes)"},"example":{"request":{"image":"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==","filterType":"grayscale","format":"webp"}}}],"usage":{"authentication":"Include x402 payment headers with each request","paymentFlow":"1. Client initiates request with x402 headers. 2. Server validates payment. 3. Image is processed. 4. Response returned with processed image.","imageFormats":{"input":["svg","jpeg","png","webp","avif"],"output":["jpeg","png","webp","avif","thumbhash","raw"]},"limits":{"maxFileSize":"50MB","qualityRange":"0-100","speedRange":"0-10 (0=slowest/best, 10=fastest)"}},"errors":{"400":"Bad Request - Invalid parameters or missing required fields","402":"Payment Required - x402 payment validation failed","500":"Internal Server Error - Image processing failed"},"links":{"x402Protocol":"https://github.com/coinbase/x402"}}