{"uid":"cap_rCworBZbRytGTK-2ETpE3","slug":"image-format-conversion-api-2054a01d","name":"Image Format Conversion API","description":"Decision-grade security/due-diligence outcome reports ($20-$100) plus deterministic paid utilities ($0.001+) for software agents and automated workflows.","url":"https://api.bakhour.ca/media/image/convert","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"format":{"enum":["jpg","png","webp"],"type":"string","default":"webp"},"quality":{"type":"integer","default":82,"maximum":95,"minimum":20},"max_width":{"type":"integer","maximum":4096,"minimum":64},"max_height":{"type":"integer","maximum":4096,"minimum":64},"source_url":{"type":"string","description":"Public HTTPS image URL. Redirects and private destinations are rejected."}}},"responseSchema":{"type":"json","example":{"bytes":12345,"format":"webp","sha256":"...","economics":{"price_usd":0.02,"estimated_local_cost_usd":0.001,"estimated_gross_profit_usd":0.019},"mime_type":"image/webp","data_base64":"..."}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","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.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_mPxfrI-ua6v_lLFBybyvP","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts a public image URL to a specified format (JPG, PNG, or WebP) with configurable quality and maximum dimensions, returning base64-encoded image data.","exampleAgentPrompt":"Convert this image to WebP format at quality 85 with a max width of 1280 pixels: https://example.com/photo.jpg","exampleUseCases":[{"title":"Optimize product images for web","prompt":"Take this product image at https://mystore.com/images/jacket.png and convert it to WebP at quality 80 with a max width of 800 pixels so it loads faster on the site."},{"title":"Standardize uploaded user avatars","prompt":"Convert this user-uploaded avatar at https://uploads.myapp.com/avatar123.jpg to PNG format at quality 90, capped at 256 pixels wide and 256 pixels tall."},{"title":"Reformat blog hero images","prompt":"I need to convert my blog hero image at https://blog.example.com/hero.jpg to WebP at quality 82 and a max width of 1920 — give me back the converted image data."}],"resultDescription":"A JSON object containing the base64-encoded converted image (data_base64), the output MIME type, output format name, file size in bytes, a SHA256 hash of the result, and an economics breakdown showing the API price, estimated local processing cost, and estimated gross profit.","failureModes":["Source URL is not publicly accessible or uses HTTP redirects — request is rejected","Source URL points to a private or non-image resource — returns error","Requested dimensions exceed the 4096px maximum — validation error","Quality value outside the 20–95 range — rejected with schema validation error","Unsupported format requested (outside jpg/png/webp) — rejected","Network timeout fetching the remote image URL"],"whenToPreferThis":"Use this endpoint when you need a deterministic, pay-per-use image format conversion from a public URL without setting up your own image processing pipeline. It is ideal for agent workflows that need to normalize image formats (especially to WebP for web delivery), resize images to bounded dimensions, and receive the result as base64 data inline — all in a single API call with transparent pricing.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:51:04.717Z","isFirstParty":false}